diff options
author | Gabe <[email protected]> | 2014-07-31 07:26:00 -0600 |
---|---|---|
committer | Martin Kosek <[email protected]> | 2014-08-25 12:32:29 +0200 |
commit | 8bb2af0e0ca375e10a406883ada5769963813763 (patch) | |
tree | 6d67b122b230e0db2d9c08cbea73727ef3a5789e /ipalib | |
parent | 2752f8e286074c210d3229ae94871afbfdc99f7f (diff) | |
download | freeipa-8bb2af0e0ca375e10a406883ada5769963813763.tar.gz freeipa-8bb2af0e0ca375e10a406883ada5769963813763.tar.xz freeipa-8bb2af0e0ca375e10a406883ada5769963813763.zip |
ipa trust-add command should be interactive
- Make ipa trust-add command interactive for realm_admin and realm_passwd
- Fix 'Active directory' typo to 'Active Directory'
https://fedorahosted.org/freeipa/ticket/3034
Reviewed-By: Jan Cholasta <[email protected]>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/trust.py | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/ipalib/plugins/trust.py b/ipalib/plugins/trust.py index fe1a76719..736cb6f57 100644 --- a/ipalib/plugins/trust.py +++ b/ipalib/plugins/trust.py @@ -435,7 +435,7 @@ sides. ), Password('realm_passwd?', cli_name='password', - label=_("Active directory domain administrator's password"), + label=_("Active Directory domain administrator's password"), confirm=False, ), Str('realm_server?', @@ -511,6 +511,30 @@ sides. return result + def interactive_prompt_callback(self, kw): + """ + Also ensure that realm_admin is prompted for if --admin or + --trust-secret is not specified when 'ipa trust-add' is run on the + system. + + Also ensure that realm_passwd is prompted for if --password or + --trust-secret is not specified when 'ipa trust-add' is run on the + system. + """ + + trust_secret = kw.get('trust_secret') + realm_admin = kw.get('realm_admin') + realm_passwd = kw.get('realm_passwd') + + if trust_secret is None: + if realm_admin is None: + kw['realm_admin'] = self.prompt_param( + self.params['realm_admin']) + + if realm_passwd is None: + kw['realm_passwd'] = self.Backend.textui.prompt_password( + self.params['realm_passwd'].label, confirm=False) + def validate_options(self, *keys, **options): if not _bindings_installed: raise errors.NotFound( |