[PATCH] Fix the handling of set_const options pulled in from the boot cmdline

Brian C. Lane bcl at redhat.com
Wed May 21 19:08:19 UTC 2014


On Wed, May 21, 2014 at 01:31:16PM -0400, David Shea wrote:
> On 05/21/2014 01:23 PM, David Shea wrote:
> >We lost option.process when switching to argparse, so we need handle the
> >set_const case ourselves in parse_boot_cmdline.
> >---
> >  pyanaconda/anaconda_argparse.py | 13 +++++++++++--
> >  1 file changed, 11 insertions(+), 2 deletions(-)
> >
> >diff --git a/pyanaconda/anaconda_argparse.py b/pyanaconda/anaconda_argparse.py
> >index ed7fa20..cfee657 100644
> >--- a/pyanaconda/anaconda_argparse.py
> >+++ b/pyanaconda/anaconda_argparse.py
> >@@ -189,12 +189,21 @@ class AnacondaArgumentParser(ArgumentParser):
> >              if option.nargs != 0 and val is None:
> >                  # nargs == 0 -> option does not take any values, skip it
> >                  continue  # TODO: emit a warning or something there?
> >-            if option.nargs == 0 and option.const is True and val in ("0", "no", "off"):
> >+            if option.nargs == 0 and option.const:
> 
> So that snarky comment I left below shows I was thinking about option.const
> == False, but I didn't think it through all of the way. The conditional here
> should be option.const is not None.

Ack

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)


More information about the anaconda-patches mailing list