diff options
author | John Dennis <jdennis@redhat.com> | 2011-06-15 15:43:26 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-06-22 01:26:01 -0400 |
commit | 8c95eb68d2315217ff1d2564b5b300aa106f4bbd (patch) | |
tree | 66956879d31e59996f37a7b78394d1afbb107ac3 /ipalib/plugins/baseldap.py | |
parent | 032b77ac23f2b92283e72cc7efcf787d22565abc (diff) | |
download | freeipa-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.py | 5 |
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: |