summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2009-02-18 17:12:14 -0500
committerRob Crittenden <rcritten@redhat.com>2009-02-19 10:09:21 -0500
commit83d5987db917b8097ff80ba4df72db754cf4f943 (patch)
tree28e3b1c6c4bb3f905fef61bd7d56c2e1098c86e7
parent4476f6b939365fa11b3d3fc94763332b93821d96 (diff)
downloadfreeipa-83d5987db917b8097ff80ba4df72db754cf4f943.tar.gz
freeipa-83d5987db917b8097ff80ba4df72db754cf4f943.tar.xz
freeipa-83d5987db917b8097ff80ba4df72db754cf4f943.zip
A new exception for requiring root, RootRequired
-rw-r--r--ipalib/errors2.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/ipalib/errors2.py b/ipalib/errors2.py
index 6d26ee575..c80edf023 100644
--- a/ipalib/errors2.py
+++ b/ipalib/errors2.py
@@ -710,6 +710,22 @@ class RealmMismatch(ExecutionError):
errno = 4005
format = _('The realm for the principal does not match the realm for this IPA server')
+class RequiresRoot(ExecutionError):
+ """
+ **4006** Raised when a command requires the unix super-user to run
+
+ For example:
+
+ >>> raise RequiresRoot
+ Traceback (most recent call last):
+ ...
+ RequiresRoot: This command requires root access
+
+ """
+
+ errno = 4006
+ format = _('This command requires root access')
+
class BuiltinError(ExecutionError):
"""
**4100** Base class for builtin execution errors (*4100 - 4199*).