]> code.ossystems Code Review - openembedded-core.git/commitdiff
wic: Make find_binary_path() more user-friendly
authorTom Zanussi <tom.zanussi@linux.intel.com>
Tue, 22 Oct 2013 14:24:04 +0000 (09:24 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 23 Oct 2013 06:14:00 +0000 (07:14 +0100)
find_binary_path() is useful, but if the binary isn't found, it prints
a stacktrace and a less-than-useful message.  Users complain when they
get stacktraces for things they can act on, so remove the stacktrace
and tell the user what the problem is.

Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/lib/mic/utils/fs_related.py

index 61617353eba0856ea23c759e99dd6d6d2c156012..dd420e88dc1669de3bf79229d6cef54d647d219b 100644 (file)
@@ -57,7 +57,10 @@ def find_binary_path(binary):
         bin_path = "%s/%s" % (path, binary)
         if os.path.exists(bin_path):
             return bin_path
-    raise CreatorError("Command '%s' is not available." % binary)
+
+    print "External command '%s' not found, exiting." % binary
+    print "  (Please install '%s' on your host system)" % binary
+    sys.exit(1)
 
 def makedirs(dirname):
     """A version of os.makedirs() that doesn't throw an