mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-06 00:14:02 -07:00
parent
2f33c1a1a1
commit
5553b20828
206 changed files with 1853 additions and 1870 deletions
|
@ -39,6 +39,7 @@ class CSVRecoder:
|
|||
def next(self):
|
||||
return self.reader.next().encode("utf-8")
|
||||
|
||||
|
||||
class CSVReader:
|
||||
"""
|
||||
A CSV reader which will iterate over lines in the CSV file "f",
|
||||
|
@ -56,6 +57,7 @@ class CSVReader:
|
|||
def __iter__(self):
|
||||
return self
|
||||
|
||||
|
||||
class LookupModule(LookupBase):
|
||||
|
||||
def read_csv(self, filename, key, delimiter, encoding='utf-8', dflt=None, col=1):
|
||||
|
@ -81,11 +83,11 @@ class LookupModule(LookupBase):
|
|||
key = params[0]
|
||||
|
||||
paramvals = {
|
||||
'col' : "1", # column to return
|
||||
'default' : None,
|
||||
'delimiter' : "TAB",
|
||||
'file' : 'ansible.csv',
|
||||
'encoding' : 'utf-8',
|
||||
'col': "1", # column to return
|
||||
'default': None,
|
||||
'delimiter': "TAB",
|
||||
'file': 'ansible.csv',
|
||||
'encoding': 'utf-8',
|
||||
}
|
||||
|
||||
# parameters specified?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue