mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
328: Command.get_default() now returns defaults for all values not present, not just defaults that aren't None
This commit is contained in:
parent
eaf15d5a52
commit
126b31de55
@ -322,9 +322,7 @@ class Command(plugable.Plugin):
|
||||
def __get_default_iter(self, kw):
|
||||
for param in self.params():
|
||||
if param.name not in kw:
|
||||
value = param.get_default(**kw)
|
||||
if value is not None:
|
||||
yield(param.name, value)
|
||||
yield (param.name, param.get_default(**kw))
|
||||
|
||||
def get_default(self, **kw):
|
||||
return dict(self.__get_default_iter(kw))
|
||||
@ -356,7 +354,7 @@ class Command(plugable.Plugin):
|
||||
kw = self.convert(**kw)
|
||||
kw.update(self.get_default(**kw))
|
||||
self.validate(**kw)
|
||||
args = tuple(kw.pop(name, None) for name in self.args)
|
||||
args = tuple(kw.pop(name) for name in self.args)
|
||||
return self.run(*args, **kw)
|
||||
|
||||
def run(self, *args, **kw):
|
||||
|
Loading…
Reference in New Issue
Block a user