mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix Parameter csv parsing
CSV values were not parsed in ipalib.parameters.normalize method properly when passed as a list and not as a basestring. Based on Jan Cholasta's contribution.
This commit is contained in:
parent
52ea3a6b29
commit
1f36ab1b78
@ -711,11 +711,17 @@ class Param(ReadOnly):
|
||||
:param value: A proposed value for this parameter.
|
||||
"""
|
||||
if self.multivalue:
|
||||
if self.csv and isinstance(value, basestring):
|
||||
csvreader = self.__unicode_csv_reader([unicode(value)])
|
||||
value = tuple(csvreader.next()) #pylint: disable=E1101
|
||||
elif type(value) not in (tuple, list):
|
||||
if type(value) not in (tuple, list):
|
||||
value = (value,)
|
||||
if self.csv:
|
||||
newval = ()
|
||||
for v in value:
|
||||
if isinstance(v, basestring):
|
||||
csvreader = self.__unicode_csv_reader([unicode(v)])
|
||||
newval += tuple(csvreader.next()) #pylint: disable=E1101
|
||||
else:
|
||||
newval += (v,)
|
||||
value = newval
|
||||
if self.normalizer is None:
|
||||
return value
|
||||
if self.multivalue:
|
||||
|
Loading…
Reference in New Issue
Block a user