Skip to content

Commit

Permalink
Low: controller: connect before updating node attribute list
Browse files Browse the repository at this point in the history
... and handle errors; should have been done with 32b9127
  • Loading branch information
kgaillot committed Oct 6, 2022
1 parent 36558d3 commit 0991870
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions daemons/controld/controld_attrd.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,21 @@ update_attrd(const char *host, const char *name, const char *value,
void
update_attrd_list(GList *attrs, uint32_t opts)
{
pcmk__attrd_api_update_list(attrd_api, attrs, NULL, NULL, NULL,
opts | pcmk__node_attr_value);
int rc = pcmk_rc_ok;

if (attrd_api == NULL) {
rc = pcmk_new_ipc_api(&attrd_api, pcmk_ipc_attrd);
}
if (rc == pcmk_rc_ok) {
rc = pcmk__attrd_api_update_list(attrd_api, attrs, NULL, NULL, NULL,
opts | pcmk__node_attr_value);
}
if (rc != pcmk_rc_ok) {
do_crm_log(AM_I_DC? LOG_CRIT : LOG_ERR,
"Could not update multiple node attributes: %s "
CRM_XS " rc=%d", pcmk_rc_str(rc), rc);
handle_attr_error();
}
}

void
Expand Down

0 comments on commit 0991870

Please sign in to comment.