[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.51
Andreas Beckmann
anbe at debian.org
Wed May 15 10:09:48 UTC 2013
The following commit has been merged in the master branch:
commit 09973095e5ab5bb788b12aec788e99f147dd2ebf
Author: Andreas Beckmann <anbe at debian.org>
Date: Mon Apr 8 01:57:59 2013 +0200
p-m: don't exit after selecting a busy or unknown section
allow another section command to try the next section
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/piuparts-master-backend.py b/piuparts-master-backend.py
index ac0dd10..feb9c24 100644
--- a/piuparts-master-backend.py
+++ b/piuparts-master-backend.py
@@ -165,8 +165,7 @@ class Master(Protocol):
try:
config.read(CONFIG_FILE)
except MissingSection:
- print 'error'
- sys.exit(0)
+ return False
if not os.path.exists(section):
os.makedirs(section)
@@ -175,8 +174,7 @@ class Master(Protocol):
try:
fcntl.flock(self._lock, fcntl.LOCK_EX | fcntl.LOCK_NB)
except IOError:
- print 'busy'
- sys.exit(0)
+ return False
self._section = section
@@ -287,8 +285,11 @@ class Master(Protocol):
self._check_args(1, command, args)
if self._init_section(args[0]):
self._short_response("ok")
- else:
+ elif self._lock is None:
+ # unknown section
self._short_response("error")
+ else:
+ self._short_response("busy")
def _recycle(self, command, args):
self._check_args(0, command, args)
--
piuparts git repository
More information about the Piuparts-commits
mailing list