summaryrefslogtreecommitdiffstats
path: root/ipalib/plugins/baseldap.py
diff options
context:
space:
mode:
authorAna Krivokapic <akrivoka@redhat.com>2013-09-23 13:56:14 +0200
committerMartin Kosek <mkosek@redhat.com>2013-11-15 12:46:07 +0100
commit6c9b3b02a4578f9985b343e4d6f716a7b829b8f0 (patch)
tree403355ed5c8bd8bcb07adcaf55fc6fcaf486266f /ipalib/plugins/baseldap.py
parent0ac63976324f93a9bba1b898c81ab740611f7fe5 (diff)
downloadfreeipa-6c9b3b02a4578f9985b343e4d6f716a7b829b8f0.tar.gz
freeipa-6c9b3b02a4578f9985b343e4d6f716a7b829b8f0.tar.xz
freeipa-6c9b3b02a4578f9985b343e4d6f716a7b829b8f0.zip
Fix error message when adding duplicate automember rule
Also fix object_name and object_name_plural for automember rules. https://fedorahosted.org/freeipa/ticket/2708
Diffstat (limited to 'ipalib/plugins/baseldap.py')
-rw-r--r--ipalib/plugins/baseldap.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 503696eff..eab8d74e0 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -582,9 +582,10 @@ class LDAPObject(Object):
)
def handle_duplicate_entry(self, *keys):
- pkey = ''
- if self.primary_key:
+ try:
pkey = keys[-1]
+ except KeyError:
+ pkey = ''
raise errors.DuplicateEntry(
message=self.already_exists_msg % {
'pkey': pkey, 'oname': self.object_name,