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

Function cib_prepare_common

cib/common.c:52–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 gboolean privileged);
51
52static xmlNode *
53cib_prepare_common(xmlNode * root, const char *section)
54{
55 xmlNode *data = NULL;
56
57 /* extract the CIB from the fragment */
58 if (root == NULL) {
59 return NULL;
60
61 } else if (safe_str_eq(crm_element_name(root), XML_TAG_FRAGMENT)
62 || safe_str_eq(crm_element_name(root), F_CRM_DATA)
63 || safe_str_eq(crm_element_name(root), F_CIB_CALLDATA)) {
64 data = first_named_child(root, XML_TAG_CIB);
65
66 } else {
67 data = root;
68 }
69
70 /* grab the section specified for the command */
71 if (section != NULL && data != NULL && crm_str_eq(crm_element_name(data), XML_TAG_CIB, TRUE)) {
72 data = get_object_root(section, data);
73 }
74
75 /* crm_log_xml_trace(root, "cib:input"); */
76 return data;
77}
78
79static int
80cib_prepare_none(xmlNode * request, xmlNode ** data, const char **section)

Callers 2

cib_prepare_dataFunction · 0.85
cib_prepare_diffFunction · 0.85

Calls 3

first_named_childFunction · 0.85
crm_str_eqFunction · 0.85
get_object_rootFunction · 0.85

Tested by

no test coverage detected