[bitbake-devel] [PATCH 2/6] toaster: runbuilds move the execution sequence out of the poll loop

Elliot Smith elliot.smith at intel.com
Thu May 19 12:59:29 UTC 2016


From: Michael Wood <michael.g.wood at intel.com>

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 at intel.com>
Signed-off-by: Elliot Smith <elliot.smith at intel.com>
---
 .../bldcontrol/management/commands/runbuilds.py    | 31 +++++++++++-----------
 1 file changed, 16 insertions(+), 15 deletions(-)

diff --git a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py b/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
index 5532b9d..e3145e8 100644
--- a/bitbake/lib/toaster/bldcontrol/management/commands/runbuilds.py
+++ b/bitbake/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)
-- 
1.9.3

---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.




More information about the bitbake-devel mailing list