csvfile - let the config system do the typecasting.

pull/82263/head
Herman van Rink 1 year ago
parent a4b00793be
commit e609d52c01
No known key found for this signature in database
GPG Key ID: BFDF74CF6CDAE489

@ -0,0 +1,4 @@
---
minor_changes:
- csvfile - let the config system do the typecasting.

@ -15,7 +15,8 @@ DOCUMENTATION = r"""
options:
col:
description: column to return (0 indexed).
default: "1"
default: 1
type: int
keycol:
description: column to search in (0 indexed).
default: 0
@ -135,7 +136,7 @@ class LookupModule(LookupBase):
for row in creader:
if len(row) and row[keycol] == key:
return row[int(col)]
return row[col]
except Exception as e:
raise AnsibleError("csvfile: %s" % to_native(e))

Loading…
Cancel
Save