[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51
Andreas Beckmann
anbe at debian.org
Wed May 15 10:09:32 UTC 2013
The following commit has been merged in the master branch:
commit 39fd667b14dcc9522deeae3e463e7ffa9f78d80f
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Mar 18 09:50:00 2013 +0100
p-m: raise CommandSyntaxError on unknown commands
instead of getting a KeyError
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/debian/changelog b/debian/changelog
index 1c27434..93c9104 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -14,6 +14,7 @@ piuparts (0.51) UNRELEASED; urgency=low
- Get the (global) 'log-file' from piuparts.conf and handle the error
logging. No longer uses the section specific logfile name for errors.
* piuparts-master-backend.py:
+ - Raise CommandSyntaxError on unknown commands.
* piuparts-slave.py:
- Fix parsing 'idle' return value from master.
- Let the piuparts-master (wrapper script) handle chdir and error logging.
diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index ef5a824..08e061e 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -221,10 +221,12 @@ class Master(Protocol):
if len(parts) > 0:
command = parts[0]
args = parts[1:]
- self._commands[command](command, args)
- return True
- else:
- return False
+ if command in self._commands:
+ self._commands[command](command, args)
+ return True
+ else:
+ raise CommandSyntaxError("Unknown command %s" % command)
+ return False
def _check_args(self, count, command, args):
if len(args) != count:
--
piuparts git repository
More information about the Piuparts-commits
mailing list