Replace os.access with stat calls for determining the executability of a given path.

This commit is contained in:
Michael Lambert 2012-09-24 13:47:59 -05:00 committed by Michael DeHaan
commit 29ac1a8efc
3 changed files with 16 additions and 2 deletions

View file

@ -76,7 +76,7 @@ class Inventory(object):
all.add_host(Host(tokens[0], tokens[1]))
else:
all.add_host(Host(x))
elif os.access(host_list, os.X_OK):
elif utils.is_executable(host_list):
self._is_script = True
self.parser = InventoryScript(filename=host_list)
self.groups = self.parser.groups.values()