summaryrefslogtreecommitdiffstats
path: root/ipalib/parameters.py
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-06-01 18:59:58 +0200
committerRob Crittenden <rcritten@redhat.com>2009-06-02 16:20:35 -0400
commita1548bc6707a0c8dd0652598a3f8ddd453345b7a (patch)
tree909b80ad950652f07857c497b559fbf06e96a5a0 /ipalib/parameters.py
parent8345e8e1f15521be5e6351441de60f0b3c389391 (diff)
downloadfreeipa-a1548bc6707a0c8dd0652598a3f8ddd453345b7a.tar.gz
freeipa-a1548bc6707a0c8dd0652598a3f8ddd453345b7a.tar.xz
freeipa-a1548bc6707a0c8dd0652598a3f8ddd453345b7a.zip
Fix bug where List parameters where always cloned with keywords parsed from name.
Diffstat (limited to 'ipalib/parameters.py')
-rw-r--r--ipalib/parameters.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 2ecc6178d..c32272e57 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -251,9 +251,11 @@ class Param(ReadOnly):
self.password = False
# Merge in kw from parse_param_spec():
- if not ('required' in kw or 'multivalue' in kw):
- (name, kw_from_spec) = parse_param_spec(name)
- kw.update(kw_from_spec)
+ (name, kw_from_spec) = parse_param_spec(name)
+ if not 'required' in kw:
+ kw['required'] = kw_from_spec['required']
+ if not 'multivalue' in kw:
+ kw['multivalue'] = kw_from_spec['multivalue']
self.name = check_name(name)
self.nice = '%s(%r)' % (self.__class__.__name__, self.param_spec)
@@ -1175,9 +1177,7 @@ class List(Param):
yield [unicode(cell, 'utf-8') for cell in row]
def __init__(self, name, *rules, **kw):
- (name, kw_from_spec) = parse_param_spec(name)
- kw.update(kw_from_spec)
- kw.update(multivalue=True)
+ kw['multivalue'] = True
super(List, self).__init__(name, *rules, **kw)
def normalize(self, value):
@@ -1235,3 +1235,4 @@ def create_param(spec):
TYPE_ERROR % ('spec', (str, Param), spec, type(spec))
)
return Str(spec)
+