[PATCH] Fix bool parsing of boot options with inst. prefix (#1044391)
Martin Kolman
mkolman at redhat.com
Wed Jan 8 16:40:06 UTC 2014
On Wed, 2014-01-08 at 17:25 +0100, Vratislav Podzimek wrote:
> On Wed, 2014-01-08 at 14:52 +0100, Martin Kolman wrote:
> > Previously when calling flags.cmdline.getbool("geoloc, True),
> > False was correctly returned for "geoloc=0", but True was returned
> > if inst.geoloc=0 was used, as "inst.geoloc" was considered a separate
> > option from "geoloc". This should be now fixed.
> >
> > Signed-off-by: Martin Kolman <mkolman at redhat.com>
> > ---
> > pyanaconda/flags.py | 11 +++++++++++
> > 1 file changed, 11 insertions(+)
> >
> > diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py
> > index f9d6de9..52f62d1 100644
> > --- a/pyanaconda/flags.py
> > +++ b/pyanaconda/flags.py
> > @@ -150,7 +150,18 @@ class BootArgs(OrderedDict):
> >
> > lst = shlex.split(cmdline)
> >
> > + # options might have the inst. prefix
> > + # (used to differentiate boot options for the
> > + # installer from other boot options)
> > + inst_prefix = "inst."
> > +
> > for i in lst:
> > + # drop the inst. prefix (if found),
> > + # so that getbool() works consistently
> > + # for both "foo=0" and "inst.foo=0"
> > + if i.startswith(inst_prefix):
> > + i = i[len(inst_prefix):]
> > +
> > if "=" in i:
> > (key, val) = i.split("=", 1)
> > else:
> Looks good to me. Just please squash the comment into two lines.
OK, will do.
>
More information about the anaconda-patches
mailing list