vars_loader should get the path to the inventory + vars_plugins

parent ad089959
...@@ -92,7 +92,7 @@ class Inventory(object): ...@@ -92,7 +92,7 @@ class Inventory(object):
else: else:
raise errors.AnsibleError("YAML inventory support is deprecated in 0.6 and removed in 0.7, see the migration script in examples/scripts in the git checkout") raise errors.AnsibleError("YAML inventory support is deprecated in 0.6 and removed in 0.7, see the migration script in examples/scripts in the git checkout")
utils.plugins.vars_loader.add_directory(self.basedir()) utils.plugins.vars_loader.add_directory(self.basedir(), with_subdir=True)
else: else:
raise errors.AnsibleError("Unable to find an inventory file, specify one with -i ?") raise errors.AnsibleError("Unable to find an inventory file, specify one with -i ?")
......
...@@ -68,9 +68,11 @@ class PluginLoader(object): ...@@ -68,9 +68,11 @@ class PluginLoader(object):
ret += self._get_package_path() ret += self._get_package_path()
return ret return ret
def add_directory(self, directory): def add_directory(self, directory, with_subdir=False):
"""Adds an additional directory to the search path""" """Adds an additional directory to the search path"""
if directory is not None: if directory is not None:
if with_subdir:
directory = os.path.join(directory, self.subdir)
self._extra_dirs.append(directory) self._extra_dirs.append(directory)
def print_paths(self): def print_paths(self):
......
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