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

Fix the "gnt-cluster getmaster" command by making the LuQueryClusterInfo

runnable on non-master nodes (and remove the list of instances and nodes
returned by it, that information can be retrieved by other opcodes).

Also, remove the node/instance list from "gnt-cluster info" as it
doesn't make sense to duplicate this information.

Reviewed-by: imsnah
parent 5fcdc80d
......@@ -1468,6 +1468,7 @@ class LUQueryClusterInfo(NoHooksLU):
_OP_REQP = []
def CheckPrereq(self):
"""No prerequsites needed for this LU.
......@@ -1479,8 +1480,6 @@ class LUQueryClusterInfo(NoHooksLU):
"""Return cluster config.
instances = [self.cfg.GetInstanceInfo(name)
for name in self.cfg.GetInstanceList()]
result = {
"name": self.sstore.GetClusterName(),
"software_version": constants.RELEASE_VERSION,
......@@ -1490,9 +1489,6 @@ class LUQueryClusterInfo(NoHooksLU):
"export_version": constants.EXPORT_VERSION,
"master": self.sstore.GetMasterNode(),
"architecture": (platform.architecture()[0], platform.machine()),
"instances": [(, instance.primary_node)
for instance in instances],
"nodes": self.cfg.GetNodeList(),
return result
......@@ -102,17 +102,10 @@ def ShowClusterConfig(opts, args):
print ("Cluster name: %s" % result["name"])
print ("Architecture: %s (%s)" %
(result["architecture"][0], result["architecture"][1]))
print ("Master node: %s" % result["master"])
print ("Instances:")
for name, node in result["instances"]:
print (" - %s (on %s)" % (name, node))
print ("Nodes:")
for name in result["nodes"]:
print (" - %s" % name)
print ("Architecture (this node): %s (%s)" %
(result["architecture"][0], result["architecture"][1]))
return 0
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