mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
parent
3b0e81ce06
commit
91b39acd6b
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user