From a2656173afe2017b1e31cf8134386c66bd7ba6e5 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Mon, 15 Oct 2007 11:45:13 +0000
Subject: [PATCH] =?UTF-8?q?Make=20=E2=80=9Cgnt-os=20diagnose=E2=80=9D=20ex?=
 =?UTF-8?q?it=201=20if=20not=20all=20OSes=20are=20valid.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Reviewed-by: iustinp
---
 scripts/gnt-os | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/gnt-os b/scripts/gnt-os
index ab57ce9f0..82c2671f7 100755
--- a/scripts/gnt-os
+++ b/scripts/gnt-os
@@ -174,6 +174,8 @@ def DiagnoseOS(opts, args):
   logger.ToStdout(format % (max_name, 'Name', max_node, 'Status/Node',
                             'Details'))
 
+  has_bad = False
+
   for os_name in all_os:
     nodes_valid = {}
     nodes_bad = {}
@@ -192,8 +194,10 @@ def DiagnoseOS(opts, args):
       status = "valid"
     elif not nodes_valid and nodes_bad:
       status = "invalid"
+      has_bad = True
     else:
       status = "partial valid"
+      has_bad = True
 
     def _OutputNodeHiddenOSStatus(dobj_list):
       for dobj in dobj_list:
@@ -213,6 +217,8 @@ def DiagnoseOS(opts, args):
     _OutputPerNodeOSStatus(nodes_valid)
     _OutputPerNodeOSStatus(nodes_bad)
 
+  return int(has_bad)
+
 
 commands = {
   'list': (ListOS, ARGS_NONE, [DEBUG_OPT, NOHDR_OPT], "",
-- 
GitLab