diff options
author | Jan Cholasta <jcholast@redhat.com> | 2013-06-25 12:58:37 +0000 |
---|---|---|
committer | Alexander Bokovoy <abokovoy@redhat.com> | 2013-07-11 12:39:25 +0300 |
commit | 100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4 (patch) | |
tree | 27bf5a35b396177642ccfee3bfe5b210dcdc7c52 /ipalib/plugins/hostgroup.py | |
parent | ab96ca7831ad8ab2ee2389093ea8b9327d94d6f0 (diff) | |
download | freeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.tar.gz freeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.tar.xz freeipa-100f13d95b51ab5b8a2a4b7dfb04c5f3b58015d4.zip |
Use LDAP search instead of *group_show to check if a group exists.
https://fedorahosted.org/freeipa/ticket/3706
Diffstat (limited to 'ipalib/plugins/hostgroup.py')
-rw-r--r-- | ipalib/plugins/hostgroup.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/plugins/hostgroup.py b/ipalib/plugins/hostgroup.py index 9fb102928..bc10994d4 100644 --- a/ipalib/plugins/hostgroup.py +++ b/ipalib/plugins/hostgroup.py @@ -122,7 +122,7 @@ class hostgroup_add(LDAPCreate): assert isinstance(dn, DN) try: # check duplicity with hostgroups first to provide proper error - netgroup = api.Command['hostgroup_show'](keys[-1]) + api.Object['hostgroup'].get_dn_if_exists(keys[-1]) self.obj.handle_duplicate_entry(*keys) except errors.NotFound: pass @@ -130,7 +130,7 @@ class hostgroup_add(LDAPCreate): try: # when enabled, a managed netgroup is created for every hostgroup # make sure that the netgroup can be created - netgroup = api.Command['netgroup_show'](keys[-1]) + api.Object['netgroup'].get_dn_if_exists(keys[-1]) raise errors.DuplicateEntry(message=unicode(_(\ u'netgroup with name "%s" already exists. ' \ u'Hostgroups and netgroups share a common namespace'\ |