diff options
-rw-r--r-- | ipalib/plugins/baseldap.py | 5 | ||||
-rw-r--r-- | tests/test_xmlrpc/test_config_plugin.py | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 895ec682a..2851f0f27 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -1255,6 +1255,9 @@ class LDAPUpdate(LDAPQuery, crud.Update): set(self.obj.default_attributes + entry_attrs.keys()) ) + _check_single_value_attrs(self.params, entry_attrs) + _check_empty_attrs(self.obj.params, entry_attrs) + for callback in self.PRE_CALLBACKS: if hasattr(callback, 'im_self'): dn = callback( @@ -1265,8 +1268,6 @@ class LDAPUpdate(LDAPQuery, crud.Update): self, ldap, dn, entry_attrs, attrs_list, *keys, **options ) - _check_single_value_attrs(self.params, entry_attrs) - _check_empty_attrs(self.obj.params, entry_attrs) ldap.get_schema() _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.limit_object_classes), entry_attrs.keys(), allow_only=True) _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.disallow_object_classes), entry_attrs.keys(), allow_only=False) diff --git a/tests/test_xmlrpc/test_config_plugin.py b/tests/test_xmlrpc/test_config_plugin.py index fbe389106..da549bfb3 100644 --- a/tests/test_xmlrpc/test_config_plugin.py +++ b/tests/test_xmlrpc/test_config_plugin.py @@ -21,6 +21,7 @@ Test the `ipalib/plugins/config.py` module. """ +from ipalib import errors from xmlrpc_test import Declarative, fuzzy_digits, fuzzy_uuid class test_config(Declarative): @@ -52,4 +53,11 @@ class test_config(Declarative): ), ), + dict( + desc='Try to remove ipausersearchfields', + command=('config_mod', [], + dict(delattr=u'ipausersearchfields=uid,givenname,sn,telephonenumber,ou,title')), + expected=errors.RequirementError(name='ipausersearchfields'), + ), + ] |