summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-09-10 10:20:24 +0000
committerPetr Viktorin <pviktori@redhat.com>2013-11-05 13:56:55 +0100
commitdf5f4ee81d1aff1122dd92ab1b56eb335294c3a7 (patch)
treeb112b429a896789029038bd3e25218495b647d56 /ipalib
parent989493979da3ef1136a9b346cace5689ef22eed8 (diff)
downloadfreeipa.git-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.tar.gz
freeipa.git-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.tar.xz
freeipa.git-df5f4ee81d1aff1122dd92ab1b56eb335294c3a7.zip
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
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/host.py6
-rw-r--r--ipalib/plugins/service.py6
2 files changed, 6 insertions, 6 deletions
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)
diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py
index 0a49d8d3..50dfbb9e 100644
--- a/ipalib/plugins/service.py
+++ b/ipalib/plugins/service.py
@@ -259,7 +259,7 @@ def update_krbticketflags(ldap, entry_attrs, attrs_list, options, existing):
old_entry_attrs = entry_attrs
try:
- ticket_flags = old_entry_attrs.single_value('krbticketflags')
+ ticket_flags = old_entry_attrs.single_value['krbticketflags']
ticket_flags = int(ticket_flags)
except (KeyError, ValueError):
ticket_flags = _ticket_flags_default
@@ -275,8 +275,8 @@ def set_kerberos_attrs(entry_attrs, options):
return
try:
- ticket_flags = entry_attrs.single_value('krbticketflags',
- _ticket_flags_default)
+ ticket_flags = entry_attrs.single_value.get('krbticketflags',
+ _ticket_flags_default)
ticket_flags = int(ticket_flags)
except ValueError:
return