From 8c95eb68d2315217ff1d2564b5b300aa106f4bbd Mon Sep 17 00:00:00 2001 From: John Dennis Date: Wed, 15 Jun 2011 15:43:26 -0400 Subject: Use DN class in get_primary_key_from_dn to return decoded value --- ipalib/plugins/baseldap.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: -- cgit