Retrieve password/keytab state when modifying a host.

ticket https://fedorahosted.org/freeipa/ticket/1714
This commit is contained in:
Rob Crittenden 2011-08-25 09:24:47 -04:00 committed by Endi S. Dewata
parent 50a898855c
commit 6dfd7c8242
2 changed files with 7 additions and 0 deletions

View File

@ -667,6 +667,11 @@ class host_mod(LDAPUpdate):
if options.get('random', False):
entry_attrs['randompassword'] = unicode(getattr(context, 'randompassword'))
set_certificate_attrs(entry_attrs)
self.obj.get_password_attributes(ldap, dn, entry_attrs)
if entry_attrs['has_password']:
# If an OTP is set there is no keytab, at least not one
# fetched anywhere.
entry_attrs['has_keytab'] = False
if options.get('all', False):
entry_attrs['managing'] = self.obj.get_managed_hosts(dn)

View File

@ -255,6 +255,8 @@ class test_host(Declarative):
md5_fingerprint=fuzzy_hash,
sha1_fingerprint=fuzzy_hash,
issuer=fuzzy_issuer,
has_keytab=False,
has_password=False,
),
),
),