summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-08-25 09:24:47 -0400
committerEndi S. Dewata <edewata@redhat.com>2011-08-25 16:38:38 +0000
commit6dfd7c8242c564faae9f74a86cdc12e7f58d08ca (patch)
treebc3a11c70391c6047a7f24cf391436560f7d1f60
parent50a898855c044d88d069c69dfe5d2659e4eceed9 (diff)
downloadfreeipa-6dfd7c8242c564faae9f74a86cdc12e7f58d08ca.tar.gz
freeipa-6dfd7c8242c564faae9f74a86cdc12e7f58d08ca.tar.xz
freeipa-6dfd7c8242c564faae9f74a86cdc12e7f58d08ca.zip
Retrieve password/keytab state when modifying a host.
ticket https://fedorahosted.org/freeipa/ticket/1714
-rw-r--r--ipalib/plugins/host.py5
-rw-r--r--tests/test_xmlrpc/test_host_plugin.py2
2 files changed, 7 insertions, 0 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 6e9efec1a..6c590ca4f 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -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)
diff --git a/tests/test_xmlrpc/test_host_plugin.py b/tests/test_xmlrpc/test_host_plugin.py
index f7746407b..5e7137060 100644
--- a/tests/test_xmlrpc/test_host_plugin.py
+++ b/tests/test_xmlrpc/test_host_plugin.py
@@ -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,
),
),
),