From 31467e703f37fef6c6ec1e3d070b8d8b6da5182c Mon Sep 17 00:00:00 2001
From: Alexander van Amesfoort <amesfoort@astron.nl>
Date: Wed, 17 May 2017 11:19:28 +0000
Subject: [PATCH] Task #8691: ObservationStartListener: fix more wrong usages
 of parser.error()

---
 .../src/ObservationStartListener.py                       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py b/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py
index dc20374136e..2305f9a8d33 100755
--- a/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py
+++ b/LCS/MessageDaemons/ObservationStartListener/src/ObservationStartListener.py
@@ -251,7 +251,7 @@ def checkArgs(parser, options, leftOverArgs):
 
     options.execPath = os.path.abspath(options.execPath)  # for -d or systemd
     if not os.path.isfile(options.execPath) or not os.access(options.execPath, os.X_OK):
-        parser.error('--exec (-x): No such executable file at %s', options.execPath)
+        parser.error('--exec (-x): No such executable file at ' + options.execPath)
 
     options.msgSaveDir = os.path.abspath(options.msgSaveDir)  # for -d or systemd
     if options.msgSaveDir and options.msgSaveDir[-1] != os.path.sep:
@@ -260,11 +260,11 @@ def checkArgs(parser, options, leftOverArgs):
         os.makedirs(options.msgSaveDir)  # exist_ok=True only since Python 3.2
     except OSError as exc:
         if exc.errno != os.errno.EEXIST or not os.path.isdir(options.msgSaveDir):
-            parser.error('--msg-save-dir (-m): Failed to create %s: %s',
-                         exc.filename, exc.strerror)
+            parser.error('--msg-save-dir (-m): Failed to create %s: %s' %
+                         (exc.filename, exc.strerror))
 
     if leftOverArgs:
-        parser.error('unused command line arguments: %s' % leftOverArgs)
+        parser.error('unused command line arguments: ' + leftOverArgs)
 
 def main(args):
     """
-- 
GitLab