def resources_status(argv): info_dom = utils.getClusterState() print "Resources:" resources = info_dom.getElementsByTagName("resources") if resources.length == 0: utils.err("no resources section found") for resource in resources[0].getElementsByTagName("resource"): nodes = resource.getElementsByTagName("node") node_line = "" if nodes.length > 0: for node in nodes: node_line += node.getAttribute("name") + " " print "", resource.getAttribute("id"), print "(" + resource.getAttribute("resource_agent") + ")", print "- " + resource.getAttribute("role") + " " + node_line
def resources_status(argv): info_dom = utils.getClusterState() print("Resources:") resources = info_dom.getElementsByTagName("resources") if resources.length == 0: utils.err("no resources section found") for resource in resources[0].getElementsByTagName("resource"): nodes = resource.getElementsByTagName("node") node_line = "" if nodes.length > 0: for node in nodes: node_line += node.getAttribute("name") + " " print("", resource.getAttribute("id"), end=' ') print("(" + resource.getAttribute("resource_agent") + ")", end=' ') print("- " + resource.getAttribute("role") + " " + node_line)
def resources_status(argv): info_dom = utils.getClusterState() print "Resources:" groups = {} nongroup_resources = [] resources = info_dom.getElementsByTagName("resources") if resources.length == 0: print "Error: No resources section found" sys.exit(1) for resource in resources[0].getElementsByTagName("resource"): nodes = resource.getElementsByTagName("node") node_line = "" if nodes.length > 0: for node in nodes: node_line += node.getAttribute("name") + " " print "", resource.getAttribute("id"), print "(" + resource.getAttribute("resource_agent") + ")", print "- " + resource.getAttribute("role") + " " + node_line