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

Function cib_remove_node

tools/crm_node.c:86–117  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84/* *INDENT-ON* */
85
86static int
87cib_remove_node(uint32_t id, const char *name)
88{
89 int rc;
90 cib_t *cib = NULL;
91 xmlNode *node = NULL;
92 xmlNode *node_state = NULL;
93
94 crm_trace("Removing %s from the CIB", name);
95
96 node = create_xml_node(NULL, XML_CIB_TAG_NODE);
97 node_state = create_xml_node(NULL, XML_CIB_TAG_STATE);
98
99 crm_xml_add(node, XML_ATTR_UNAME, name);
100 crm_xml_add(node_state, XML_ATTR_UNAME, name);
101
102 cib = cib_new();
103 cib->cmds->signon(cib, crm_system_name, cib_command);
104
105 rc = cib->cmds->delete(cib, XML_CIB_TAG_NODES, node, cib_sync_call);
106 if(rc != pcmk_ok) {
107 printf("Could not remove %s from "XML_CIB_TAG_NODES": %s", name, pcmk_strerror(rc));
108 }
109 rc = cib->cmds->delete(cib, XML_CIB_TAG_STATUS, node_state, cib_sync_call);
110 if(rc != pcmk_ok) {
111 printf("Could not remove %s from "XML_CIB_TAG_STATUS": %s", name, pcmk_strerror(rc));
112 }
113
114 cib->cmds->signoff(cib);
115 cib_delete(cib);
116 return rc;
117}
118
119int
120crmd_remove_node_cache(const char *id)

Callers 2

crmd_remove_node_cacheFunction · 0.85
try_openaisFunction · 0.85

Calls 5

create_xml_nodeFunction · 0.85
crm_xml_addFunction · 0.85
cib_newFunction · 0.85
pcmk_strerrorFunction · 0.85
cib_deleteFunction · 0.85

Tested by

no test coverage detected