MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / do_find_node_list

Function do_find_node_list

tools/crmadmin.c:585–614  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

583}
584
585int
586do_find_node_list(xmlNode * xml_node)
587{
588 int found = 0;
589 xmlNode *node = NULL;
590 xmlNode *nodes = get_object_root(XML_CIB_TAG_NODES, xml_node);
591
592 for (node = __xml_first_child(nodes); node != NULL; node = __xml_next(node)) {
593 if (crm_str_eq((const char *)node->name, XML_CIB_TAG_NODE, TRUE)) {
594
595 if (BASH_EXPORT) {
596 printf("export %s=%s\n",
597 crm_element_value(node, XML_ATTR_UNAME),
598 crm_element_value(node, XML_ATTR_ID));
599 } else {
600 printf("%s node: %s (%s)\n",
601 crm_element_value(node, XML_ATTR_TYPE),
602 crm_element_value(node, XML_ATTR_UNAME),
603 crm_element_value(node, XML_ATTR_ID));
604 }
605 found++;
606 }
607 }
608
609 if (found == 0) {
610 printf("NO nodes configured\n");
611 }
612
613 return found;
614}

Callers 1

do_workFunction · 0.85

Calls 5

get_object_rootFunction · 0.85
__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85
crm_str_eqFunction · 0.85
crm_element_valueFunction · 0.85

Tested by

no test coverage detected