Since all tests are either flags.cmdline.has_key() or "if flags.cmdline.get()", we want this to be None when there's no equals sign, rather than True. --- flags.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/flags.py b/flags.py index 8dbcc9f..d49b252 100644 --- a/flags.py +++ b/flags.py @@ -59,7 +59,7 @@ class Flags: (key, val) = i.split("=", 1) except: key = i - val = True + val = None
cmdlineDict[key] = val
Since all tests are either flags.cmdline.has_key() or "if flags.cmdline.get()", we want this to be None when there's no equals sign, rather than True.
Looks fine to me.
- Chris
On Wed, 2009-04-29 at 15:44 -0400, Peter Jones wrote:
Since all tests are either flags.cmdline.has_key() or "if flags.cmdline.get()", we want this to be None when there's no equals sign, rather than True.
This breaks at least 'debug' as a boot time option. The flags dict is setting {'debug': None} and so later in gui.py or others tests for "flags.debug" are coming out as false. I haven't finished checking all of the other flags that we stuff in to the flags dict, and that are not foo=bar flags, but there is potential for more breakage here.
What were you trying to fix here?
On Wed, 2009-08-12 at 15:24 -0700, Jesse Keating wrote:
This breaks at least 'debug' as a boot time option. The flags dict is setting {'debug': None} and so later in gui.py or others tests for "flags.debug" are coming out as false. I haven't finished checking all of the other flags that we stuff in to the flags dict, and that are not foo=bar flags, but there is potential for more breakage here.
What were you trying to fix here?
This only seems to break debug, autostep, and autoscreenshot. I've been looking for a way to fix it but I'm running into troubles.
I could in flags.py forcefully set these to "True". There is already a call to set the debug value. However this seems to go against the spirit of the patch that broke things in the first place.
I could change every call of "if flags.debug" to "if flags.cmdline.has_key('debug')", however that would break cases where anaconda was called manually with a --debug flag.
I could change every call of "if flags.debug" to "if flags.debug or flags.cmdline.has_key('debug')" but that just seems silly.
Since we have to handle both the case where something was picked up from /proc/cmdline, or something was picked up as an anaconda --foo option, we should set up the flags attribute the same both ways, which looks to me as "True".
anaconda-devel@lists.stg.fedoraproject.org