Commit e88fc57d authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix the type of 'valid' attribute in LUDiagnoseOS

The update of the valid status in LUDiagnoseOS says:

  valid = valid and osl and osl[0][1]

However, in Python, “True and []” (which '[]' we get for an invalid OS)
will result in “[]”, and thus the valid field for an OS will be either
True or an empty list. Which is not what we want…
Signed-off-by: default avatarIustin Pop <>
Reviewed-by: default avatarGuido Trotter <>
parent baa17cda
......@@ -2780,7 +2780,7 @@ class LUDiagnoseOS(NoHooksLU):
valid = True
variants = None
for osl in os_data.values():
valid = valid and osl and osl[0][1]
valid = bool(valid and osl and osl[0][1])
if not valid:
variants = set()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment