[oe-commits] [bitbake] 11/20: toaster: orm models Handle run builds process not yet running

git at git.openembedded.org git at git.openembedded.org
Thu Nov 3 13:34:27 UTC 2016


rpurdie pushed a commit to branch master-next
in repository bitbake.

commit 79d3145d824a2de28cdf7bbebc2d3ef927b1d000
Author: Michael Wood <michael.g.wood at intel.com>
AuthorDate: Fri Oct 28 18:48:47 2016 +0300

    toaster: orm models Handle run builds process not yet running
    
    During tests we may want to call the runbuilds process manually for
    example when doing a "one shot" approach rather than a long running
    process during tests.
    
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/toaster/orm/models.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/toaster/orm/models.py b/lib/toaster/orm/models.py
index a7de57c..9a4db1e 100644
--- a/lib/toaster/orm/models.py
+++ b/lib/toaster/orm/models.py
@@ -1741,8 +1741,12 @@ def invalidate_cache(**kwargs):
 
 def signal_runbuilds():
     """Send SIGUSR1 to runbuilds process"""
-    with open(os.path.join(os.getenv('BUILDDIR'), '.runbuilds.pid')) as pidf:
-        os.kill(int(pidf.read()), SIGUSR1)
+    try:
+        with open(os.path.join(os.getenv('BUILDDIR'),
+                               '.runbuilds.pid')) as pidf:
+            os.kill(int(pidf.read()), SIGUSR1)
+    except FileNotFoundError:
+        logger.info("Stopping existing runbuilds: no current process found")
 
 django.db.models.signals.post_save.connect(invalidate_cache)
 django.db.models.signals.post_delete.connect(invalidate_cache)

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


More information about the Openembedded-commits mailing list