From a0c4ab93abee6bfcba30b886319e5f2d7e8ab988 Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Thu, 10 Jun 2010 11:48:28 -0400 Subject: [PATCH] If an option is deprecated, do not care if it takes a value (#602303). The problem here is that if an option that ever did have a type that requires a value (string, for instance) then when that option is later deprecated, it will still require a value. Then you'll get a parse error instead of the deprecation warning, which doesn't make a lot of sense. --- pykickstart/options.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pykickstart/options.py b/pykickstart/options.py index 5f5aa37..cd09472 100644 --- a/pykickstart/options.py +++ b/pykickstart/options.py @@ -188,6 +188,11 @@ class KSOption (Option): else: Option.take_action(self, action, dest, opt, value, values, parser) + def takes_value(self): + # Deprecated options don't take a value. + return Option.takes_value(self) and not self.deprecated + def __init__(self, *args, **kwargs): + self.deprecated = False self.required = False Option.__init__(self, *args, **kwargs) -- 2.11.4.GIT