[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.49-82-g7e76d1d
Andreas Beckmann
anbe at debian.org
Sat Feb 23 10:48:32 UTC 2013
The following commit has been merged in the develop branch:
commit 1456e6de12b8d0c05e879a173d2d597f3238a106
Author: Andreas Beckmann <anbe at debian.org>
Date: Wed Feb 20 21:41:50 2013 +0100
p-s: flush and unreserve all sections on interrupt
Signed-off-by: Andreas Beckmann <anbe at debian.org>
diff --git a/debian/changelog b/debian/changelog
index d782283..66d482f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -23,6 +23,7 @@ piuparts (0.50) UNRELEASED; urgency=low
- Tarball recreation can be disabled by setting max-tgz-age to 0.
- Relax package existence checks to allow distupgrading to backports.
- Fix SIGHUP handling while recycling.
+ - Flush and unreserve all sections on interrupt.
* piuparts-analyze.py:
- Add support for magic "$DISTRO/None" versions.
* piuparts-report.py:
diff --git a/piuparts-slave.py b/piuparts-slave.py
index 2cfec8b..f568bc6 100644
--- a/piuparts-slave.py
+++ b/piuparts-slave.py
@@ -364,7 +364,10 @@ class Section:
def _count_submittable_logs(self):
files = 0
- for logdir in ["pass", "fail", "untestable"]:
+ subdirs = ["pass", "fail", "untestable"]
+ if interrupted:
+ subdirs += ["reserved", "new"]
+ for logdir in subdirs:
for basename in os.listdir(os.path.join(self._slave_directory, logdir)):
if basename.endswith(".log"):
files += 1
@@ -420,7 +423,7 @@ class Section:
logging.info("busy")
self._error_wait_until = time.time() + 900
else:
- if self._talk_to_master(fetch=do_processing, recycle=recycle):
+ if self._talk_to_master(fetch=do_processing, recycle=recycle, unreserve=interrupted):
if do_processing:
if not self._slave.get_reserved():
self._idle_wait_until = time.time() + int(self._config["idle-sleep"])
@@ -538,8 +541,6 @@ class Section:
if interrupted:
break
self._talk_to_master(unreserve=interrupted)
- if interrupted:
- raise KeyboardInterrupt
return test_count
@@ -843,6 +844,9 @@ def main():
if test_count > 0 and idle_until < time.time():
break
+ if interrupted:
+ raise KeyboardInterrupt
+
if test_count == 0 and not got_sighup:
now = time.time()
sleep_until = min([now + int(global_config["idle-sleep"])] + [section.sleep_until() for section in sections])
--
piuparts git repository
More information about the Piuparts-commits
mailing list