]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/buildstats-diff: check that the given directory exists
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 29 Sep 2016 14:27:58 +0000 (17:27 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Sep 2016 16:14:11 +0000 (17:14 +0100)
Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/buildstats-diff

index 8ee2aaf626e1ad2a6ba8b629e5927b82aa5c49e1..d0cd7669a33f821387695296c9ad3e7880d87b9c 100755 (executable)
@@ -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)