From: Ed Bartosh Date: Tue, 27 Sep 2016 15:16:53 +0000 (+0100) Subject: bitbake: toaster: check if file exist X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc4c02a268e92839f5ebb36cbf7a6b71082e09c4;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git bitbake: 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] (Bitbake rev: 54565e7ca84d2722a2454e7fa52cda564b28b527) Signed-off-by: Ed Bartosh Signed-off-by: Michael Wood Signed-off-by: Richard Purdie --- diff --git a/bitbake/lib/bb/ui/buildinfohelper.py b/bitbake/lib/bb/ui/buildinfohelper.py index b2c74ddf7a2..970a9415c16 100644 --- a/bitbake/lib/bb/ui/buildinfohelper.py +++ b/bitbake/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