diff options
author | Rob Crittenden <rcritten@redhat.com> | 2010-03-04 16:20:42 -0500 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2010-03-17 23:52:15 -0600 |
commit | 1400c85188b63d44c44fddd1e9bf68b0b7b868ba (patch) | |
tree | 5d3175534fa6b057d4c3fec62f02d1b2c22577b9 /ipalib/plugins/pwpolicy.py | |
parent | f0d51b65f18d73e9b97e22e9fa4146468fed3d16 (diff) | |
download | freeipa-1400c85188b63d44c44fddd1e9bf68b0b7b868ba.tar.gz freeipa-1400c85188b63d44c44fddd1e9bf68b0b7b868ba.tar.xz freeipa-1400c85188b63d44c44fddd1e9bf68b0b7b868ba.zip |
Catch modifications with no updates and raise an error
569848
Diffstat (limited to 'ipalib/plugins/pwpolicy.py')
-rw-r--r-- | ipalib/plugins/pwpolicy.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index 2d4b70486..447e1cef3 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -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) |