Show hidden/blacklisted OSes in cluster info
authorIustin Pop <iustin@google.com>
Wed, 26 Jan 2011 13:39:39 +0000 (14:39 +0100)
committerIustin Pop <iustin@google.com>
Wed, 26 Jan 2011 14:50:44 +0000 (15:50 +0100)
Since we can blacklist/hide non-existing OSes (for preseeding), we
cannot query easily the OSes themselves for this status. Hence we
export the entire lists in cluster info (which should be cheaper than
gnt-os diagnose).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

lib/client/gnt_cluster.py
lib/cmdlib.py

index 99fc31e..d430d48 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2010 Google Inc.
+# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -321,6 +321,9 @@ def ShowClusterConfig(opts, args):
   ToStdout("OS parameters:")
   _PrintGroupedParams(result["osparams"])
 
+  ToStdout("Hidden OSes: %s", utils.CommaJoin(result["hidden_os"]))
+  ToStdout("Blacklisted OSes: %s", utils.CommaJoin(result["blacklisted_os"]))
+
   ToStdout("Cluster parameters:")
   ToStdout("  - candidate pool size: %s",
             compat.TryToRoman(result["candidate_pool_size"],
index a39c8f8..51e94ff 100644 (file)
@@ -4604,6 +4604,8 @@ class LUClusterQuery(NoHooksLU):
       "reserved_lvs": cluster.reserved_lvs,
       "primary_ip_version": primary_ip_version,
       "prealloc_wipe_disks": cluster.prealloc_wipe_disks,
+      "hidden_os": cluster.hidden_os,
+      "blacklisted_os": cluster.blacklisted_os,
       }
 
     return result