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

Function attrd_update_delegate

lib/common/utils.c:1747–1847  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1745}
1746
1747int
1748attrd_update_delegate(crm_ipc_t *ipc, char command, const char *host, const char *name,
1749 const char *value, const char *section, const char *set, const char *dampen,
1750 const char *user_name)
1751{
1752 int rc = 0;
1753 int max = 5;
1754 enum crm_ipc_flags flags = crm_ipc_client_none;
1755 xmlNode *update = create_xml_node(NULL, __FUNCTION__);
1756
1757 static gboolean connected = TRUE;
1758 static crm_ipc_t *local_ipc = NULL;
1759
1760 if(ipc == NULL && local_ipc == NULL) {
1761 local_ipc = crm_ipc_new(T_ATTRD, 0);
1762 flags |= crm_ipc_client_response;
1763 connected = FALSE;
1764 }
1765
1766 if(ipc == NULL) {
1767 ipc = local_ipc;
1768 }
1769
1770 /* remap common aliases */
1771 if (safe_str_eq(section, "reboot")) {
1772 section = XML_CIB_TAG_STATUS;
1773
1774 } else if (safe_str_eq(section, "forever")) {
1775 section = XML_CIB_TAG_NODES;
1776 }
1777
1778
1779 crm_xml_add(update, F_TYPE, T_ATTRD);
1780 crm_xml_add(update, F_ORIG, crm_system_name);
1781
1782 if (name == NULL && command == 'U') {
1783 command = 'R';
1784 }
1785
1786 switch (command) {
1787 case 'D':
1788 case 'U':
1789 case 'v':
1790 crm_xml_add(update, F_ATTRD_TASK, "update");
1791 crm_xml_add(update, F_ATTRD_ATTRIBUTE, name);
1792 break;
1793 case 'R':
1794 crm_xml_add(update, F_ATTRD_TASK, "refresh");
1795 break;
1796 case 'q':
1797 crm_xml_add(update, F_ATTRD_TASK, "query");
1798 break;
1799 }
1800
1801 crm_xml_add(update, F_ATTRD_VALUE, value);
1802 crm_xml_add(update, F_ATTRD_DAMPEN, dampen);
1803 crm_xml_add(update, F_ATTRD_SECTION, section);
1804 crm_xml_add(update, F_ATTRD_HOST, host);

Callers 7

mainFunction · 0.85
delete_lrm_rscFunction · 0.85
mainFunction · 0.85
attrd_updateFunction · 0.85
attrd_lazy_updateFunction · 0.85
attrd_update_no_mainloopFunction · 0.85
update_attrdFunction · 0.85

Calls 8

create_xml_nodeFunction · 0.85
crm_ipc_newFunction · 0.85
crm_xml_addFunction · 0.85
crm_ipc_connectFunction · 0.85
crm_ipc_sendFunction · 0.85
crm_ipc_closeFunction · 0.85
free_xmlFunction · 0.85
pcmk_strerrorFunction · 0.85

Tested by

no test coverage detected