Merge pull request #11733 from amenonsen/csvfile

v2 breakage: lookupfile should lookup the given file=xxx
pull/10083/merge
Brian Coca 9 years ago
commit 5be384bab0

@ -75,7 +75,7 @@ class LookupModule(LookupBase):
if paramvals['delimiter'] == 'TAB':
paramvals['delimiter'] = "\t"
lookupfile = self._loader.path_dwim_relative(basedir, 'files', term)
lookupfile = self._loader.path_dwim_relative(basedir, 'files', paramvals['file'])
var = self.read_csv(lookupfile, key, paramvals['delimiter'], paramvals['default'], paramvals['col'])
if var is not None:
if type(var) is list:

@ -63,6 +63,9 @@ class LookupModule(object):
for param in params[1:]:
name, value = param.split('=')
assert(name in paramvals)
if name == 'delimiter':
paramvals[name] = str(value)
else:
paramvals[name] = value
except (ValueError, AssertionError), e:
raise errors.AnsibleError(e)

Loading…
Cancel
Save