From: Markus Lehtonen Date: Thu, 29 Sep 2016 14:27:58 +0000 (+0300) Subject: scripts/buildstats-diff: check that the given directory exists X-Git-Tag: 2016-10~189 X-Git-Url: https://code.ossystems.io/gitweb?a=commitdiff_plain;h=08082b96d8d09215f02e9251f354bb6e8bb3e712;p=openembedded-core.git scripts/buildstats-diff: check that the given directory exists Signed-off-by: Markus Lehtonen Signed-off-by: Ross Burton --- diff --git a/scripts/buildstats-diff b/scripts/buildstats-diff index 8ee2aaf626..d0cd7669a3 100755 --- a/scripts/buildstats-diff +++ b/scripts/buildstats-diff @@ -115,11 +115,14 @@ def read_buildstats_dir(bs_dir): if os.path.isfile(os.path.join(bs_dir, 'build_stats')): top_dir = bs_dir - else: + elif os.path.exists(bs_dir): subdirs = sorted(glob.glob(bs_dir + '/*')) if len(subdirs) > 1: log.warning("Multiple buildstats found, using the first one") top_dir = subdirs[0] + else: + log.error("No such directory: %s", bs_dir) + sys.exit(1) log.debug("Reading buildstats directory %s", top_dir) subdirs = os.listdir(top_dir)