diff options
author | Jason Gerard DeRose <jderose@redhat.com> | 2009-01-22 11:21:34 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2009-02-03 15:29:00 -0500 |
commit | 46c10d4608508de01a65d6e6076104d88c63b253 (patch) | |
tree | d769ee7ba84c6dff4cfee0f034f6cfa627389d8e | |
parent | 12c4879613f51c90239be749a777f480310b1318 (diff) | |
download | freeipa-46c10d4608508de01a65d6e6076104d88c63b253.tar.gz freeipa-46c10d4608508de01a65d6e6076104d88c63b253.tar.xz freeipa-46c10d4608508de01a65d6e6076104d88c63b253.zip |
Removed bogus CLI.set_defaults() method that was causing non-required values to get filled in
-rw-r--r-- | ipalib/cli.py | 16 | ||||
-rw-r--r-- | ipalib/frontend.py | 1 | ||||
-rw-r--r-- | ipalib/plugins/f_user.py | 2 |
3 files changed, 7 insertions, 12 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index 9eb3c092..809c0e55 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -696,7 +696,6 @@ class CLI(object): if self.options.interactive: self.prompt_interactively(cmd, kw) self.prompt_for_passwords(cmd, kw) - self.set_defaults(cmd, kw) result = cmd(**kw) if callable(cmd.output_for_cli): for param in cmd.params(): @@ -708,16 +707,9 @@ class CLI(object): (args, options) = cmd.params_2_args_options(**kw) cmd.output_for_cli(self.api.Backend.textui, result, *args, **options) - def set_defaults(self, cmd, kw): - for param in cmd.params(): - if not kw.get(param.name): - value = param.get_default(**kw) - if value: - kw[param.name] = value - def prompt_for_passwords(self, cmd, kw): for param in cmd.params(): - if 'password' not in param.flags: + if not isinstance(param, Password): continue if kw.get(param.name, False) is True or param.name in cmd.args: kw[param.name] = self.textui.prompt_password( @@ -738,11 +730,12 @@ class CLI(object): optional. """ for param in cmd.params(): - if 'password' in param.flags: + if isinstance(param, Password): continue elif param.name not in kw: - if not (param.required or self.options.prompt_all): + if not param.required and not self.options.prompt_all: continue + print 'prompting for %r' % param.name default = param.get_default(**kw) error = None while True: @@ -758,6 +751,7 @@ class CLI(object): error = e.error return kw + # FIXME: This should be done as the plugins are loaded # if self.api.env.server_context: # try: diff --git a/ipalib/frontend.py b/ipalib/frontend.py index 67f0a89c..2277c7a0 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -96,6 +96,7 @@ class Command(plugable.Plugin): If not in a server context, the call will be forwarded over XML-RPC and the executed an the nearest IPA server. """ + self.debug(make_repr(self.name, *args, **options)) params = self.args_options_2_params(*args, **options) params = self.normalize(**params) params = self.convert(**params) diff --git a/ipalib/plugins/f_user.py b/ipalib/plugins/f_user.py index f1134fb2..58ff53cd 100644 --- a/ipalib/plugins/f_user.py +++ b/ipalib/plugins/f_user.py @@ -217,7 +217,7 @@ class user_del(crud.Delete): api.register(user_del) -class user_mod(crud.Mod): +class user_mod(crud.Update): 'Edit an existing user.' def execute(self, uid, **kw): """ |