mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-28 09:06:44 -06:00
Allow multi-line CSV parameters
Feed individual lines of input into the CSV parser, and include all lines in the output. https://fedorahosted.org/freeipa/ticket/2402
This commit is contained in:
parent
18a6ab356a
commit
0b62700c8c
@ -715,14 +715,15 @@ class Param(ReadOnly):
|
||||
if self.csv:
|
||||
if type(value) not in (tuple, list):
|
||||
value = (value,)
|
||||
newval = ()
|
||||
newval = []
|
||||
for v in value:
|
||||
if isinstance(v, basestring):
|
||||
csvreader = self.__unicode_csv_reader([unicode(v)])
|
||||
newval += tuple(csvreader.next()) #pylint: disable=E1101
|
||||
lines = unicode(v).splitlines()
|
||||
for row in self.__unicode_csv_reader(lines):
|
||||
newval.extend(row)
|
||||
else:
|
||||
newval += (v,)
|
||||
return newval
|
||||
newval.append(v)
|
||||
return tuple(newval)
|
||||
else:
|
||||
return value
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user