Revision 59322403
b/lib/cmdlib.py | ||
---|---|---|
1468 | 1468 |
|
1469 | 1469 |
""" |
1470 | 1470 |
_OP_REQP = [] |
1471 |
REQ_MASTER = False |
|
1471 | 1472 |
|
1472 | 1473 |
def CheckPrereq(self): |
1473 | 1474 |
"""No prerequsites needed for this LU. |
... | ... | |
1479 | 1480 |
"""Return cluster config. |
1480 | 1481 |
|
1481 | 1482 |
""" |
1482 |
instances = [self.cfg.GetInstanceInfo(name) |
|
1483 |
for name in self.cfg.GetInstanceList()] |
|
1484 | 1483 |
result = { |
1485 | 1484 |
"name": self.sstore.GetClusterName(), |
1486 | 1485 |
"software_version": constants.RELEASE_VERSION, |
... | ... | |
1490 | 1489 |
"export_version": constants.EXPORT_VERSION, |
1491 | 1490 |
"master": self.sstore.GetMasterNode(), |
1492 | 1491 |
"architecture": (platform.architecture()[0], platform.machine()), |
1493 |
"instances": [(instance.name, instance.primary_node) |
|
1494 |
for instance in instances], |
|
1495 |
"nodes": self.cfg.GetNodeList(), |
|
1496 | 1492 |
} |
1497 | 1493 |
|
1498 | 1494 |
return result |
b/scripts/gnt-cluster | ||
---|---|---|
102 | 102 |
|
103 | 103 |
print ("Cluster name: %s" % result["name"]) |
104 | 104 |
|
105 |
print ("Architecture: %s (%s)" % |
|
106 |
(result["architecture"][0], result["architecture"][1])) |
|
107 |
|
|
108 | 105 |
print ("Master node: %s" % result["master"]) |
109 | 106 |
|
110 |
print ("Instances:") |
|
111 |
for name, node in result["instances"]: |
|
112 |
print (" - %s (on %s)" % (name, node)) |
|
113 |
print ("Nodes:") |
|
114 |
for name in result["nodes"]: |
|
115 |
print (" - %s" % name) |
|
107 |
print ("Architecture (this node): %s (%s)" % |
|
108 |
(result["architecture"][0], result["architecture"][1])) |
|
116 | 109 |
|
117 | 110 |
return 0 |
118 | 111 |
|
Also available in: Unified diff