mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
329: Command.convert() now converts all keys, not just keys in params
This commit is contained in:
parent
126b31de55
commit
15b83ab1bf
@ -299,15 +299,10 @@ class Command(plugable.Plugin):
|
||||
for option in self.get_options():
|
||||
yield create_param(option)
|
||||
|
||||
def __convert_iter(self, kw):
|
||||
for (key, value) in kw.iteritems():
|
||||
if key in self.params:
|
||||
yield (key, self.params[key].convert(value))
|
||||
else:
|
||||
yield (key, value)
|
||||
|
||||
def convert(self, **kw):
|
||||
return dict(self.__convert_iter(kw))
|
||||
return dict(
|
||||
(k, self.params[k].convert(v)) for (k, v) in kw.iteritems()
|
||||
)
|
||||
|
||||
def __normalize_iter(self, kw):
|
||||
for (key, value) in kw.iteritems():
|
||||
|
@ -486,8 +486,6 @@ class test_Command(ClassChecker):
|
||||
kw = dict(
|
||||
option0='option0',
|
||||
option1='option1',
|
||||
whatever=False,
|
||||
also=object,
|
||||
)
|
||||
expected = dict(kw)
|
||||
expected.update(dict(option0=u'option0', option1=u'option1'))
|
||||
|
Loading…
Reference in New Issue
Block a user