diff options
author | Jr Aquino <jr.aquino@citrix.com> | 2011-06-16 11:57:13 -0700 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2011-06-16 19:21:07 -0400 |
commit | 44cdf8ef54ff761a5e38919b8cdce5128928985a (patch) | |
tree | 9faa2078dfcea92034b4d7c480ab67b37415e18e /ipalib/errors.py | |
parent | 0377123b191a0c94434ef1eeda653426ddd0a440 (diff) | |
download | freeipa-44cdf8ef54ff761a5e38919b8cdce5128928985a.tar.gz freeipa-44cdf8ef54ff761a5e38919b8cdce5128928985a.tar.xz freeipa-44cdf8ef54ff761a5e38919b8cdce5128928985a.zip |
Raise DuplicateEntry Error when adding a duplicate sudo option
https://fedorahosted.org/freeipa/ticket/1276
https://fedorahosted.org/freeipa/ticket/1277
https://fedorahosted.org/freeipa/ticket/1308
Added new Exception: AttrValueNotFound
Fixed XML Test for Sudorule remove_option
1276 (Raise AttrValueNotFound when trying to remove a non-existent option from Sudo rule)
1277 (Raise DuplicateEntry Error when adding a duplicate sudo option)
1308 (Make sudooption a required option for sudorule_remove_option)
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r-- | ipalib/errors.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py index 55bb8a38b..cad6e37b4 100644 --- a/ipalib/errors.py +++ b/ipalib/errors.py @@ -1192,6 +1192,24 @@ class ReverseMemberError(ExecutionError): format = _('A problem was encountered when verifying that all members were %(verb)s: %(exc)s') +class AttrValueNotFound(ExecutionError): + """ + **4026** Raised when an Attribute/Value pair is not found. + + For example: + + >>> raise NotFound(attr='ipasudoopt', value='authenticate') + Traceback (most recent call last): + ... + AttrValueNotFound: ipasudoopt does not contain 'authenticate'. + + """ + + errno = 4026 + rval = 1 + format = _('%(attr)s does not contain \'%(value)s\'') + + class BuiltinError(ExecutionError): """ **4100** Base class for builtin execution errors (*4100 - 4199*). |