diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 05:49:30 +0000 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2008-09-24 05:49:30 +0000 |
commit | 95abdcd7147399c9bb10adc2a04e41ddc97b2302 (patch) | |
tree | 240dc2c097a3ea19278b16d8772b36aa74333657 /ipalib | |
parent | 15b83ab1bf9d94e4f5cf292623d194b6a8094616 (diff) | |
download | freeipa-95abdcd7147399c9bb10adc2a04e41ddc97b2302.tar.gz freeipa-95abdcd7147399c9bb10adc2a04e41ddc97b2302.tar.xz freeipa-95abdcd7147399c9bb10adc2a04e41ddc97b2302.zip |
330: Command.normalize() now normalizes all keys, not just keys in params
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/frontend.py | 11 | ||||
-rw-r--r-- | ipalib/tests/test_frontend.py | 1 |
2 files changed, 3 insertions, 9 deletions
diff --git a/ipalib/frontend.py b/ipalib/frontend.py index fc397530a..f3264d81b 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -304,15 +304,10 @@ class Command(plugable.Plugin): (k, self.params[k].convert(v)) for (k, v) in kw.iteritems() ) - def __normalize_iter(self, kw): - for (key, value) in kw.iteritems(): - if key in self.params: - yield (key, self.params[key].normalize(value)) - else: - yield (key, value) - def normalize(self, **kw): - return dict(self.__normalize_iter(kw)) + return dict( + (k, self.params[k].normalize(v)) for (k, v) in kw.iteritems() + ) def __get_default_iter(self, kw): for param in self.params(): diff --git a/ipalib/tests/test_frontend.py b/ipalib/tests/test_frontend.py index db831caa7..88232bed4 100644 --- a/ipalib/tests/test_frontend.py +++ b/ipalib/tests/test_frontend.py @@ -504,7 +504,6 @@ class test_Command(ClassChecker): kw = dict( option0=u'OPTION0', option1=u'OPTION1', - option2=u'option2', ) norm = dict((k, v.lower()) for (k, v) in kw.items()) sub = self.subcls() |