summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2011-06-15 15:43:26 -0400
committerRob Crittenden <rcritten@redhat.com>2011-06-22 01:26:01 -0400
commit8c95eb68d2315217ff1d2564b5b300aa106f4bbd (patch)
tree66956879d31e59996f37a7b78394d1afbb107ac3 /ipalib/plugins/baseldap.py
parent032b77ac23f2b92283e72cc7efcf787d22565abc (diff)
downloadfreeipa-8c95eb68d2315217ff1d2564b5b300aa106f4bbd.tar.gz
freeipa-8c95eb68d2315217ff1d2564b5b300aa106f4bbd.tar.xz
freeipa-8c95eb68d2315217ff1d2564b5b300aa106f4bbd.zip
Use DN class in get_primary_key_from_dn to return decoded value
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 7ea5e3671..95e628cd0 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -33,6 +33,7 @@ from ipalib.cli import to_cli, from_cli
from ipalib import output
from ipalib.text import _
from ipalib.util import json_serialize
+from ipalib.dn import *
global_output_params = (
Str('member',
@@ -318,7 +319,9 @@ class LDAPObject(Object):
return ''
except errors.NotFound:
pass
- return dn[len(self.primary_key.name) + 1:dn.find(',')]
+ # DN object assures we're returning a decoded (unescaped) value
+ dn = DN(dn)
+ return dn[self.primary_key.name]
def get_ancestor_primary_keys(self):
if self.parent_object: