mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Catch modifications with no updates and raise an error
569848
This commit is contained in:
committed by
Jason Gerard DeRose
parent
f0d51b65f1
commit
1400c85188
@@ -270,6 +270,9 @@ class LDAPUpdate(LDAPQuery, crud.Update):
|
||||
def execute(self, *keys, **options):
|
||||
ldap = self.obj.backend
|
||||
|
||||
if len(options) == 2: # 'all' and 'raw' are always sent
|
||||
raise errors.EmptyModlist()
|
||||
|
||||
dn = self.obj.get_dn(*keys, **options)
|
||||
|
||||
entry_attrs = self.args_options_2_entry(**options)
|
||||
|
||||
@@ -238,14 +238,20 @@ class pwpolicy_mod(crud.Update):
|
||||
assert 'dn' not in options
|
||||
ldap = self.api.Backend.ldap2
|
||||
|
||||
if not 'group' in options:
|
||||
if 'group' in options:
|
||||
group_cn = options['group']
|
||||
del options['group']
|
||||
else:
|
||||
group_cn = _global
|
||||
if len(options) == 2: # 'all' and 'raw' are always sent
|
||||
raise errors.EmptyModlist()
|
||||
|
||||
if not 'group' in options:
|
||||
if 'cospriority' in options:
|
||||
raise errors.ValidationError(name='priority', error=_('priority cannot be set on global policy'))
|
||||
dn = self.api.env.container_accounts
|
||||
entry_attrs = self.args_options_2_entry(*args, **options)
|
||||
else:
|
||||
group_cn = options['group']
|
||||
if 'cospriority' in options:
|
||||
groupdn = find_group_dn(options['group'])
|
||||
cos_dn = 'cn="%s", cn=cosTemplates, cn=accounts, %s' % (groupdn, api.env.basedn)
|
||||
|
||||
Reference in New Issue
Block a user