[oe-commits] [bitbake] 12/15: toaster: check if file exist

git at git.openembedded.org git at git.openembedded.org
Wed Sep 28 14:05:07 UTC 2016


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

commit 54565e7ca84d2722a2454e7fa52cda564b28b527
Author: Ed Bartosh <ed.bartosh at linux.intel.com>
AuthorDate: Tue Sep 27 16:16:53 2016 +0100

    toaster: check if file exist
    
    Buildinfohelper assumes that all files mentioned in
    manifest exist in deploy/ directory, which is not always
    the case. Toaster crashes with OSError trying to
    call os.stat on non-existing file.
    
    Checking if file exists before processing it should
    fix this.
    
    [YOCTO #10185]
    
    Signed-off-by: Ed Bartosh <ed.bartosh at linux.intel.com>
    Signed-off-by: Michael Wood <michael.g.wood at intel.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
 lib/bb/ui/buildinfohelper.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/bb/ui/buildinfohelper.py b/lib/bb/ui/buildinfohelper.py
index b2c74dd..970a941 100644
--- a/lib/bb/ui/buildinfohelper.py
+++ b/lib/bb/ui/buildinfohelper.py
@@ -1758,6 +1758,9 @@ class BuildInfoHelper(object):
 
                 for basename in basenames:
                     artifact_path = os.path.join(deploy_dir_image, basename)
+                    if not os.path.exists(artifact_path):
+                        logger.warning("artifact %s doesn't exist, skipping" % artifact_path)
+                        continue
                     artifact_size = os.stat(artifact_path).st_size
 
                     # note that the artifact will only be saved against this

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


More information about the Openembedded-commits mailing list