diff options
author | Petr Vobornik <pvoborni@redhat.com> | 2015-05-07 12:41:12 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-05-12 12:41:34 +0200 |
commit | 91b39acd6bca1a1054220291f4b4a0a4118e829c (patch) | |
tree | 7252d6572480872545427739ccc469ecfe8a7344 /ipalib | |
parent | 3b0e81ce062e63a3ca45df1cd997196cc340f565 (diff) | |
download | freeipa-91b39acd6bca1a1054220291f4b4a0a4118e829c.tar.gz freeipa-91b39acd6bca1a1054220291f4b4a0a4118e829c.tar.xz freeipa-91b39acd6bca1a1054220291f4b4a0a4118e829c.zip |
cli: differentiate Flag a Bool when autofill is set
With previous behavior there was no difference between Flag and Bool if
- autofill == True
- default = some value
It prevented to have a boolean which is set by default to true, but could
be set to False if users wants to without prompting in interactive shell.
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/cli.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py index bbf616d14..fc6e23039 100644 --- a/ipalib/cli.py +++ b/ipalib/cli.py @@ -48,7 +48,7 @@ from errors import (PublicError, CommandError, HelpError, InternalError, NoSuchNamespaceError, ValidationError, NotFound, NotConfiguredError, PromptFailed) from constants import CLI_TAB, LDAP_GENERALIZED_TIME_FORMAT -from parameters import File, Str, Enum, Any +from parameters import File, Str, Enum, Any, Flag from text import _ from ipapython.version import API_VERSION from ipapython.dnsutil import DNSName @@ -1150,7 +1150,7 @@ class cli(backend.Executioner): continue if option.password and self.env.interactive: kw['action'] = 'store_true' - elif option.type is bool and option.autofill: + elif isinstance(option, Flag): if option.default is True: kw['action'] = 'store_false' else: |