diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index 880c5a0b7672226eec2fc1cd0dbe3faf1128380d..1f890a5dfaec80933be2aa93ebd49f1f2b03719f 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -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()
             break