summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-08-20 18:17:27 -0400
committerRob Crittenden <rcritten@redhat.com>2009-08-26 09:51:15 -0400
commit7a7041045e127e0537bd5eb1592bf58c846bb64d (patch)
treea8ef1cee07eed1654daf55098700f9e8ac8ca67e /ipalib
parentdacfddfdc8be7411abef5bd1c1107907f545dc6f (diff)
downloadfreeipa-7a7041045e127e0537bd5eb1592bf58c846bb64d.tar.gz
freeipa-7a7041045e127e0537bd5eb1592bf58c846bb64d.tar.xz
freeipa-7a7041045e127e0537bd5eb1592bf58c846bb64d.zip
Fix service_mod and add a test case
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/service.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py
index 8d852ca47..8e9554282 100644
--- a/ipalib/plugins/service.py
+++ b/ipalib/plugins/service.py
@@ -215,22 +215,21 @@ class service_mod(crud.Update):
"""
Modify service.
"""
- def execute(self, principal, **kw):
- ldap = self.api.Backend.ldap
+ def execute(self, principal, **options):
+ ldap = self.api.Backend.ldap2
# FIXME, should be in a normalizer. Need to fix normalizers to work
# on non-unicode data.
- if kw.get('usercertificate'):
- kw['usercertificate'] = base64.b64decode(kw['usercertificate'])
+ if options.get('usercertificate'):
+ options['usercertificate'] = base64.b64decode(options['usercertificate'])
- dn = ldap.make_dn(entry_attrs, 'krbprincipalname', _container_dn)
+ entry_attrs = self.args_options_2_entry(*tuple(), **options)
+ dn = ldap.make_dn_from_attr('krbprincipalname', principal, _container_dn)
(dn, old_entry_attrs) = ldap.get_entry(dn)
- if 'usercertificate' in old_entry_attrs and 'usercerficate' in kw:
+ if 'usercertificate' in old_entry_attrs and 'usercerficate' in options:
# FIXME, what to do here? Do we revoke the old cert?
raise errors.GenericError(format='entry already has a certificate')
- entry_attrs = self.args_options_to_entry(principal, **kw)
-
try:
ldap.update_entry(dn, entry_attrs)
except errors.EmptyModlist: