Skip to contentSkip to conversation

wic/engine.py: improve error message when required tools are missing

PATCH New Anuj Mittal 1 participant 1 message Jun 1, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wic/engine.py: improve error message when required tools are missing

Instead of showing that command 'None' was found, show the name of actual command that wasn't found on the host machine or at the native sysroot path provided by user.

---
 scripts/lib/wic/engine.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/lib/wic/engine.py +2 -2
index edcfab39ef..94992365df 100644
@@ -284,8 +284,8 @@ class Disk:
             aname = "_%s" % name
             if aname not in self.__dict__:
                 setattr(self, aname, find_executable(name, self.paths))
-                if aname not in self.__dict__:
-                    raise WicError("Can't find executable {}".format(name))
+                if aname not in self.__dict__ or self.__dict__[aname] is None:
+                    raise WicError("Can't find executable '{}'".format(name))
             return self.__dict__[aname]
         return self.__dict__[name]
 
Signature · 1 line
2.17.0