aboutsummaryrefslogtreecommitdiffstats
path: root/lib/toaster/bldcontrol/management/commands/runbuilds.py
diff options
context:
space:
mode:
authorMichael Wood <michael.g.wood@intel.com>2016-05-19 13:59:29 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-20 10:07:10 +0100
commite8e059602c31394a4be5293e2ca0b8434fb4a8cf (patch)
tree55230a63bd15d8e2af70db70c9ca8279e0d55399 /lib/toaster/bldcontrol/management/commands/runbuilds.py
parent973c740404ca6a09feea250d3433075995067fe0 (diff)
downloadbitbake-contrib-e8e059602c31394a4be5293e2ca0b8434fb4a8cf.tar.gz
toaster: runbuilds move the execution sequence out of the poll loop
Move the execution sequence for a build out of the polling loop and into it's own fuction. This means that we can call the function on it's own if we just want to trigger one build rather than infinite polling. This is something needed for the build tests. Signed-off-by: Michael Wood <michael.g.wood@intel.com> Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/toaster/bldcontrol/management/commands/runbuilds.py')
-rw-r--r--lib/toaster/bldcontrol/management/commands/runbuilds.py31
1 files changed, 16 insertions, 15 deletions
diff --git a/lib/toaster/bldcontrol/management/commands/runbuilds.py b/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 5532b9deb..e3145e8be 100644
--- a/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/lib/toaster/bldcontrol/management/commands/runbuilds.py
@@ -158,22 +158,23 @@ class Command(NoArgsCommand):
br.environment.lock = BuildEnvironment.LOCK_FREE
br.environment.save()
+ def runbuild(self):
+ try:
+ self.cleanup()
+ except Exception as e:
+ logger.warn("runbuilds: cleanup exception %s" % str(e))
- def handle_noargs(self, **options):
- while True:
- try:
- self.cleanup()
- except Exception as e:
- logger.warning("runbuilds: cleanup exception %s" % str(e))
-
- try:
- self.archive()
- except Exception as e:
- logger.warning("runbuilds: archive exception %s" % str(e))
+ try:
+ self.archive()
+ except Exception as e:
+ logger.warn("runbuilds: archive exception %s" % str(e))
- try:
- self.schedule()
- except Exception as e:
- logger.warning("runbuilds: schedule exception %s" % str(e))
+ try:
+ self.schedule()
+ except Exception as e:
+ logger.warn("runbuilds: schedule exception %s" % str(e))
+ def handle_noargs(self, **options):
+ while True:
+ self.runbuild()
time.sleep(1)