summaryrefslogtreecommitdiffstats
path: root/ipalib/errors.py
diff options
context:
space:
mode:
authorAna Krivokapic <akrivoka@redhat.com>2013-04-12 17:38:09 +0200
committerRob Crittenden <rcritten@redhat.com>2013-04-12 14:07:55 -0400
commitb8b573a966f4be268031ccca5abce09767928ff7 (patch)
tree8f0e2b55e7ff18c4ba4274153fbc3ac8d80e42f1 /ipalib/errors.py
parentd03255571c9d4c81d92c692fd0b6db6539856cf8 (diff)
downloadfreeipa-b8b573a966f4be268031ccca5abce09767928ff7.tar.gz
freeipa-b8b573a966f4be268031ccca5abce09767928ff7.tar.xz
freeipa-b8b573a966f4be268031ccca5abce09767928ff7.zip
Deprecate HBAC source hosts from CLI
Hide the commands and options listed below from the CLI, but keep them in the API. When called directly from the API, raise appropriate exceptions informing the user that the functionality has been deprecated. Affected commands: hbacrule_add_sourcehost, hbacrule_remove_sourcehost. Affected options: sourcehostcategory, sourcehost_host and sourcehost_hostgroup (hbacrule); sourcehost (hbactest). https://fedorahosted.org/freeipa/ticket/3528
Diffstat (limited to 'ipalib/errors.py')
-rw-r--r--ipalib/errors.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ipalib/errors.py b/ipalib/errors.py
index 658c8cbc2..716decb2b 100644
--- a/ipalib/errors.py
+++ b/ipalib/errors.py
@@ -796,6 +796,21 @@ class PromptFailed(InvocationError):
format = _('Could not get %(name)s interactively')
+class DeprecationError(InvocationError):
+ """
+ **3015** Raise when a command has been deprecated
+
+ For example:
+
+ >>> raise DeprecationError(name='hbacrule_add_sourcehost')
+ Traceback (most recent call last):
+ ...
+ DeprecationError: Command 'hbacrule_add_sourcehost' has been deprecated
+ """
+ errno = 3015
+ format = _("Command '%(name)s' has been deprecated")
+
+
##############################################################################
# 4000 - 4999: Execution errors