diff options
author | Rob Crittenden <rcritten@redhat.com> | 2012-03-20 22:37:27 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2012-03-22 21:46:27 +0100 |
commit | b9c3eb79a953fc20e148d518babf84925524f712 (patch) | |
tree | a45d730729b58ea0e94f5fa0688690cdc3b09c76 /ipalib/plugins/baseldap.py | |
parent | 5b8e1e8c62bb899145e3572dc8bfa7cb0570fd05 (diff) | |
download | freeipa-b9c3eb79a953fc20e148d518babf84925524f712.tar.gz freeipa-b9c3eb79a953fc20e148d518babf84925524f712.tar.xz freeipa-b9c3eb79a953fc20e148d518babf84925524f712.zip |
Fix attributes that contain DNs when migrating.
Some attributes, like secretary and manager, may point to other LDAP
entries. We need to fix these during migration.
https://fedorahosted.org/freeipa/ticket/2562
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r-- | ipalib/plugins/baseldap.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 6b629dc24..a09e00fef 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -487,7 +487,15 @@ class LDAPObject(Object): pass # DN object assures we're returning a decoded (unescaped) value dn = DN(dn) - return dn[self.primary_key.name] + try: + return dn[self.primary_key.name] + except KeyError: + # The primary key is not in the DN. + # This shouldn't happen, but we don't want a "show" command to + # crash. + # Just return the entire DN, it's all we have if the entry + # doesn't exist + return unicode(dn) def get_ancestor_primary_keys(self): if self.parent_object: |