From df5f4ee81d1aff1122dd92ab1b56eb335294c3a7 Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Tue, 10 Sep 2013 10:20:24 +0000 Subject: Turn LDAPEntry.single_value into a dictionary-like property. This change makes single_value consistent with the raw property. https://fedorahosted.org/freeipa/ticket/3521 --- ipalib/plugins/host.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'ipalib/plugins/host.py') diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py index 7aa94aa9..fd65a873 100644 --- a/ipalib/plugins/host.py +++ b/ipalib/plugins/host.py @@ -585,7 +585,7 @@ class host_del(LDAPDelete): (dn, entry_attrs) = ldap.get_entry(dn, ['usercertificate']) except errors.NotFound: self.obj.handle_not_found(*keys) - cert = entry_attrs.single_value('usercertificate', None) + cert = entry_attrs.single_value.get('usercertificate') if cert: cert = x509.normalize_certificate(cert) try: @@ -667,7 +667,7 @@ class host_mod(LDAPUpdate): if self.api.env.enable_ra: x509.verify_cert_subject(ldap, keys[-1], cert) (dn, entry_attrs_old) = ldap.get_entry(dn, ['usercertificate']) - oldcert = entry_attrs_old.single_value('usercertificate', None) + oldcert = entry_attrs_old.single_value.get('usercertificate') if oldcert: oldcert = x509.normalize_certificate(oldcert) try: @@ -945,7 +945,7 @@ class host_disable(LDAPQuery): (dn, entry_attrs) = ldap.get_entry(dn, ['usercertificate']) except errors.NotFound: self.obj.handle_not_found(*keys) - cert = entry_attrs.single_value('usercertificate', None) + cert = entry_attrs.single_value.get('usercertificate') if cert: if self.api.env.enable_ra: cert = x509.normalize_certificate(cert) -- cgit