Parse command arguments before creating a context

This allows users to run `ipa COMMAND --help` even without
Kerberos credentials.

Part of the effort for https://fedorahosted.org/freeipa/ticket/3060
This commit is contained in:
Petr Viktorin
2012-11-08 08:59:31 -05:00
committed by Rob Crittenden
parent f16c100f1e
commit abe26d55c8

View File

@@ -1051,10 +1051,10 @@ class cli(backend.Executioner):
if cmd is None: if cmd is None:
return return
name = cmd.name name = cmd.name
kw = self.argv_to_keyword_arguments(cmd, argv[1:])
if not isinstance(cmd, frontend.Local): if not isinstance(cmd, frontend.Local):
self.create_context() self.create_context()
try: try:
kw = self.argv_to_keyword_arguments(cmd, argv[1:])
result = self.execute(name, **kw) result = self.execute(name, **kw)
if callable(cmd.output_for_cli): if callable(cmd.output_for_cli):
for param in cmd.params(): for param in cmd.params():