mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Rob Crittenden
parent
d03255571c
commit
b8b573a966
@@ -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``.
|
||||
|
||||
Reference in New Issue
Block a user