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 <jcholast@redhat.com>
This commit is contained in:
Gabe 2014-07-31 07:26:00 -06:00 committed by Martin Kosek
parent a25fe00c62
commit 9415aba877

View File

@ -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(