summaryrefslogtreecommitdiffstats
path: root/ipalib/cli.py
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-12-08 17:24:26 -0500
committerRob Crittenden <rcritten@redhat.com>2010-12-09 15:06:42 -0500
commit5b7abefb42bb2a962caab444ff2557ca78732f63 (patch)
tree901142c8cd766895e9a0e44231c1490d88d45b27 /ipalib/cli.py
parentbfcf25cf54943817315a5ec56ae85b1ef9866589 (diff)
downloadfreeipa-5b7abefb42bb2a962caab444ff2557ca78732f63.tar.gz
freeipa-5b7abefb42bb2a962caab444ff2557ca78732f63.tar.xz
freeipa-5b7abefb42bb2a962caab444ff2557ca78732f63.zip
If any params marked alwaysask are provided then prompt for none of them.
ticket 604
Diffstat (limited to 'ipalib/cli.py')
-rw-r--r--ipalib/cli.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/cli.py b/ipalib/cli.py
index 375607ff0..555cbac77 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -889,9 +889,14 @@ class cli(backend.Executioner):
``self.env.prompt_all`` is ``True``, this method will prompt for any
params that have a missing values, even if the param is optional.
"""
+ honor_alwaysask = True
+ for param in cmd.params():
+ if param.alwaysask and param.name in kw:
+ honor_alwaysask = False
+ break
for param in cmd.params():
if (param.required and param.name not in kw) or \
- param.alwaysask or self.env.prompt_all:
+ (param.alwaysask and honor_alwaysask) or self.env.prompt_all:
if param.password:
kw[param.name] = self.Backend.textui.prompt_password(
param.label