diff options
-rw-r--r-- | ipalib/cli.py | 2 | ||||
-rw-r--r-- | ipalib/frontend.py | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index 3692e4e53..1c88a9b1f 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -1243,6 +1243,8 @@ class cli(backend.Executioner): if param.autofill: kw[param.name] = cmd.get_default_of(param.name, **kw) if param.name in kw and kw[param.name] is not None: + if param.autofill: + del kw[param.name] continue if param.password: kw[param.name] = self.Backend.textui.prompt_password( diff --git a/ipalib/frontend.py b/ipalib/frontend.py index c7bbead32..adad3707d 100644 --- a/ipalib/frontend.py +++ b/ipalib/frontend.py @@ -442,7 +442,8 @@ class Command(HasParam): self.debug( 'raw: %s(%s)', self.name, ', '.join(self._repr_iter(**params)) ) - params.update(self.get_default(**params)) + if self.api.env.in_server: + params.update(self.get_default(**params)) params = self.normalize(**params) params = self.convert(**params) self.debug( @@ -598,7 +599,7 @@ class Command(HasParam): # Backend.textui.prompt does not fill in the default value, # we have to do it ourselves if not raw.strip(): - raw = default + return None try: return param(raw, **kw) |