pmb.flasher.run: proper check for None (MR 1986)
Change the 'not value' condition raising the '...value for this variable is None!' error to 'value is None' so it doesn't raise when the value is something else that evaluates to boolean False, like an empty string. Remove the special treatment for $KERNEL_CMDLINE here by making it default to empty string.
This commit is contained in:
parent
fae2379d6b
commit
ac796121e2
|
@ -48,7 +48,7 @@ def run(args, action, flavor=None):
|
|||
for key, value in vars.items():
|
||||
for i in range(len(command)):
|
||||
if key in command[i]:
|
||||
if not value and key != "$KERNEL_CMDLINE":
|
||||
if value is None:
|
||||
raise RuntimeError("Variable " + key + " found in"
|
||||
" action " + action + " for method " + method + ","
|
||||
" but the value for this variable is None! Is that"
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
|
||||
def variables(args, flavor, method):
|
||||
_cmdline = args.deviceinfo["kernel_cmdline"]
|
||||
_cmdline = args.deviceinfo["kernel_cmdline"] or ""
|
||||
if "cmdline" in args and args.cmdline:
|
||||
_cmdline = args.cmdline
|
||||
|
||||
|
|
Loading…
Reference in New Issue