| 930 | } |
| 931 | |
| 932 | static void |
| 933 | print_node_summary(pe_working_set_t * data_set, gboolean operations) |
| 934 | { |
| 935 | xmlNode *lrm_rsc = NULL; |
| 936 | xmlNode *rsc_entry = NULL; |
| 937 | xmlNode *node_state = NULL; |
| 938 | xmlNode *cib_status = get_object_root(XML_CIB_TAG_STATUS, data_set->input); |
| 939 | |
| 940 | if (operations) { |
| 941 | print_as("\nOperations:\n"); |
| 942 | } else { |
| 943 | print_as("\nMigration summary:\n"); |
| 944 | } |
| 945 | |
| 946 | for (node_state = __xml_first_child(cib_status); node_state != NULL; |
| 947 | node_state = __xml_next(node_state)) { |
| 948 | if (crm_str_eq((const char *)node_state->name, XML_CIB_TAG_STATE, TRUE)) { |
| 949 | node_t *node = pe_find_node_id(data_set->nodes, ID(node_state)); |
| 950 | |
| 951 | if (node == NULL || node->details->online == FALSE) { |
| 952 | continue; |
| 953 | } |
| 954 | |
| 955 | print_as("* Node %s: ", crm_element_value(node_state, XML_ATTR_UNAME)); |
| 956 | print_as("\n"); |
| 957 | |
| 958 | lrm_rsc = find_xml_node(node_state, XML_CIB_TAG_LRM, FALSE); |
| 959 | lrm_rsc = find_xml_node(lrm_rsc, XML_LRM_TAG_RESOURCES, FALSE); |
| 960 | |
| 961 | for (rsc_entry = __xml_first_child(lrm_rsc); rsc_entry != NULL; |
| 962 | rsc_entry = __xml_next(rsc_entry)) { |
| 963 | if (crm_str_eq((const char *)rsc_entry->name, XML_LRM_TAG_RESOURCE, TRUE)) { |
| 964 | if (operations) { |
| 965 | print_rsc_history(data_set, node, rsc_entry); |
| 966 | |
| 967 | } else { |
| 968 | const char *rsc_id = crm_element_value(rsc_entry, XML_ATTR_ID); |
| 969 | resource_t *rsc = pe_find_resource(data_set->resources, rsc_id); |
| 970 | |
| 971 | if (rsc) { |
| 972 | print_rsc_summary(data_set, node, rsc, FALSE); |
| 973 | } else { |
| 974 | print_as(" %s: orphan\n", rsc_id); |
| 975 | } |
| 976 | } |
| 977 | } |
| 978 | } |
| 979 | } |
| 980 | } |
| 981 | } |
| 982 | |
| 983 | static void |
| 984 | print_ticket(gpointer name, gpointer value, gpointer data) |
no test coverage detected