mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
raise ValidationError when deprecated param is passed to command
https://fedorahosted.org/freeipa/ticket/6190 Reviewed-By: Lenka Doudova <ldoudova@redhat.com>
This commit is contained in:
parent
4ca671788c
commit
82e754e9c5
@ -854,6 +854,9 @@ class Param(ReadOnly):
|
||||
if self.required or (supplied and 'nonempty' in self.flags):
|
||||
raise RequirementError(name=self.name)
|
||||
return
|
||||
if self.deprecated:
|
||||
raise ValidationError(name=self.get_param_name(),
|
||||
error=_('this option is deprecated'))
|
||||
if self.multivalue:
|
||||
if type(value) is not tuple:
|
||||
raise TypeError(
|
||||
@ -876,10 +879,6 @@ class Param(ReadOnly):
|
||||
if error is not None:
|
||||
raise ValidationError(name=self.get_param_name(), error=error)
|
||||
|
||||
def _rule_deprecated(self, _, value):
|
||||
if self.deprecated:
|
||||
return _('this option is deprecated')
|
||||
|
||||
def get_default(self, **kw):
|
||||
"""
|
||||
Return the static default or construct and return a dynamic default.
|
||||
|
Loading…
Reference in New Issue
Block a user