cli: make optional positional command arguments actually optional

Fix commands defined in ipalib.cli not to assume optional positional
arguments have a value of None when not specified.

https://fedorahosted.org/freeipa/ticket/4739

Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
Jan Cholasta 2016-05-30 08:12:32 +02:00
parent e9f0e9d8fa
commit 748a4c31bf

View File

@ -773,7 +773,7 @@ class help(frontend.Local):
super(help, self)._on_finalize()
def run(self, key, outfile=None, **options):
def run(self, key=None, outfile=None, **options):
if outfile is None:
outfile = sys.stdout
writer = self._writer(outfile)
@ -923,7 +923,7 @@ class show_api(frontend.Command):
takes_args = ('namespaces*',)
def run(self, namespaces):
def run(self, namespaces=None):
if namespaces is None:
names = tuple(self.api)
else: