Revert "Added workaround for inventory directories"

This reverts commit e856ac2320.

That commit was intended to fix --limit not honoring the playbook
directory as a source of inventory variable information.  However, the
commit changes the inventory basedir to where it thinks the playbook
basedir which breaks finding inventory variables inside of inventory
directories #15093.  Reverting this and looking for where limit might be
affecting the playbook basedir rather than the inventory basedir.
This commit is contained in:
Toshio Kuratomi 2016-03-23 12:36:38 -07:00
parent cdfbc4243a
commit 81c481739d

View file

@ -559,20 +559,11 @@ class Inventory(object):
return False
return os.path.exists(self.host_list)
def is_dir(self):
""" did inventory come from a directory? """
if not isinstance(self.host_list, basestring):
return False
return os.path.isdir(self.host_list)
def basedir(self):
""" if inventory came from a file, what's the directory? """
if not self.is_file():
return None
if self.is_dir():
dname = os.path.dirname(os.path.dirname(self.host_list))
else:
dname = os.path.dirname(self.host_list)
dname = os.path.dirname(self.host_list)
if dname is None or dname == '' or dname == '.':
cwd = os.getcwd()
return os.path.abspath(cwd)