[oe-commits] [bitbake] 05/09: toaster: runbuilds move the execution sequence out of the poll loop

git at git.openembedded.org git at git.openembedded.org
Fri May 20 09:13:24 UTC 2016


rpurdie pushed a commit to branch master
in repository bitbake.

commit e8e059602c31394a4be5293e2ca0b8434fb4a8cf
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Thu May 19 13:59:29 2016 +0100

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

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

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list