diff options
author | Ana Krivokapic <akrivoka@redhat.com> | 2013-04-12 17:38:09 +0200 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2013-04-12 14:07:55 -0400 |
commit | b8b573a966f4be268031ccca5abce09767928ff7 (patch) | |
tree | 8f0e2b55e7ff18c4ba4274153fbc3ac8d80e42f1 /ipalib/parameters.py | |
parent | d03255571c9d4c81d92c692fd0b6db6539856cf8 (diff) | |
download | freeipa-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/parameters.py')
-rw-r--r-- | ipalib/parameters.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py index a934a8fb2..ab4b83216 100644 --- a/ipalib/parameters.py +++ b/ipalib/parameters.py @@ -1800,6 +1800,23 @@ class DNParam(Param): error=ugettext(e)) return dn + +class DeprecatedParam(Any): + kwargs = Param.kwargs + ( + ('deprecate', bool, True), + ) + + def __init__(self, name, *rules, **kw): + if 'flags' in kw: + kw['flags'] = list(kw['flags']) + ['no_option'] + else: + kw['flags'] = ['no_option'] + + super(DeprecatedParam, self).__init__(name, *rules, **kw) + + def _rule_deprecate(self, _, value): + return _('this option is deprecated') + def create_param(spec): """ Create an `Str` instance from the shorthand ``spec``. |