Commit 1f7c197a by Michael DeHaan

os.path.dirname returns '' not None in some cases, handle this so inventory can…

os.path.dirname returns '' not None in some cases, handle this so inventory can be specified with ./
parent 79ec5fac
...@@ -374,7 +374,11 @@ class Inventory(object): ...@@ -374,7 +374,11 @@ class Inventory(object):
""" if inventory came from a file, what's the directory? """ """ if inventory came from a file, what's the directory? """
if not self.is_file(): if not self.is_file():
return None return None
return os.path.dirname(self.host_list) dname = os.path.dirname(self.host_list)
if dname is None or dname == '':
cwd = os.getcwd()
return cwd
return dname
def playbook_basedir(self): def playbook_basedir(self):
""" returns the directory of the current playbook """ """ returns the directory of the current playbook """
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment