diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2013-09-23 13:56:14 +0200 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2013-11-15 12:46:07 +0100 |
commit | 6c9b3b02a4578f9985b343e4d6f716a7b829b8f0 (patch) | |
tree | 403355ed5c8bd8bcb07adcaf55fc6fcaf486266f /ipalib | |
parent | 0ac63976324f93a9bba1b898c81ab740611f7fe5 (diff) | |
download | freeipa-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')
-rw-r--r-- | ipalib/plugins/automember.py | 4 | ||||
-rw-r--r-- | ipalib/plugins/baseldap.py | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/ipalib/plugins/automember.py b/ipalib/plugins/automember.py index fc696cc62..71f9a8324 100644 --- a/ipalib/plugins/automember.py +++ b/ipalib/plugins/automember.py @@ -172,8 +172,8 @@ class automember(LDAPObject): container_dn = api.env.container_automember - object_name = 'auto_member_rule' - object_name_plural = 'auto_member_rules' + object_name = 'Automember rule' + object_name_plural = 'Automember rules' object_class = ['top', 'automemberregexrule'] default_attributes = [ 'automemberinclusiveregex', 'automemberexclusiveregex', 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, |