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': if paramvals['delimiter'] == 'TAB':
paramvals['delimiter'] = "\t" 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']) var = self.read_csv(lookupfile, key, paramvals['delimiter'], paramvals['default'], paramvals['col'])
if var is not None: if var is not None:
if type(var) is list: if type(var) is list:

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

Loading…
Cancel
Save