mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
os.path.dirname returns '' not None in some cases, handle this so inventory can be specified with ./
This commit is contained in:
@@ -374,7 +374,11 @@ class Inventory(object):
|
||||
""" if inventory came from a file, what's the directory? """
|
||||
if not self.is_file():
|
||||
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):
|
||||
""" returns the directory of the current playbook """
|
||||
|
||||
Reference in New Issue
Block a user