mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Merge pull request #11733 from amenonsen/csvfile
v2 breakage: lookupfile should lookup the given file=xxx
This commit is contained in:
commit
5be384bab0
2 changed files with 5 additions and 2 deletions
|
@ -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,7 +63,10 @@ class LookupModule(object):
|
|||
for param in params[1:]:
|
||||
name, value = param.split('=')
|
||||
assert(name in paramvals)
|
||||
paramvals[name] = value
|
||||
if name == 'delimiter':
|
||||
paramvals[name] = str(value)
|
||||
else:
|
||||
paramvals[name] = value
|
||||
except (ValueError, AssertionError), e:
|
||||
raise errors.AnsibleError(e)
|
||||
|
||||
|
|
Loading…
Reference in a new issue