martbab's pull request #51: "Fix failing negative tests for deprecated params" 
was opened

PR body:

There is one last failing test. To fix it properly we will have to rework
`Parameter.__init__` method, see

See the full pull-request at
... or pull the PR as Git branch:
git remote add ghfreeipa
git fetch ghfreeipa pull/51/head:pr51
git checkout pr51
From c6cec9e59dd62b5efdb45a8cf413177b517e9c22 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <>
Date: Tue, 19 Jul 2016 17:05:32 +0200
Subject: [PATCH] raise ValidationError when deprecated param is passed to
 ipalib/ | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/ipalib/ b/ipalib/
index 6917c8d..37f9650 100644
--- a/ipalib/
+++ b/ipalib/
@@ -854,6 +854,9 @@ def validate(self, value, supplied=None):
             if self.required or (supplied and 'nonempty' in self.flags):
                 raise RequirementError(
+        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 @@ def _validate_scalar(self, value, index=None):
             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.
Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA:

Reply via email to