Skip to content

Commit c3d53d6

Browse files
committed
Refactor: tools: Drop redundant scheduler arg from clear_rsc_failures()
Signed-off-by: Reid Wahl <[email protected]>
1 parent c6748dd commit c3d53d6

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tools/crm_resource_runtime.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -842,9 +842,10 @@ clear_rsc_history(pcmk_ipc_api_t *controld_api, pcmk_node_t *node,
842842
static int
843843
clear_rsc_failures(pcmk__output_t *out, pcmk_ipc_api_t *controld_api,
844844
pcmk_node_t *node, const char *rsc_id, const char *operation,
845-
const char *interval_spec, pcmk_scheduler_t *scheduler)
845+
const char *interval_spec)
846846
{
847847
int rc = pcmk_rc_ok;
848+
pcmk_scheduler_t *scheduler = NULL;
848849
const char *failed_value = NULL;
849850
const char *failed_id = NULL;
850851
char *interval_ms_s = NULL;
@@ -853,6 +854,8 @@ clear_rsc_failures(pcmk__output_t *out, pcmk_ipc_api_t *controld_api,
853854

854855
pcmk__assert(node != NULL);
855856

857+
scheduler = node->priv->scheduler;
858+
856859
/* Create a hash table to use as a set of resources to clean. This lets us
857860
* clean each resource only once (per node) regardless of how many failed
858861
* operations it has.
@@ -1044,7 +1047,7 @@ cli_resource_delete(pcmk_ipc_api_t *controld_api, pcmk_node_t *node,
10441047

10451048
if (just_failures) {
10461049
rc = clear_rsc_failures(out, controld_api, node, rsc->id, operation,
1047-
interval_spec, scheduler);
1050+
interval_spec);
10481051
} else {
10491052
rc = clear_rsc_history(controld_api, node, rsc->id);
10501053
}
@@ -1100,14 +1103,14 @@ cli_cleanup_all(pcmk_ipc_api_t *controld_api, pcmk_node_t *node,
11001103

11011104
if (node != NULL) {
11021105
rc = clear_rsc_failures(out, controld_api, node, NULL, operation,
1103-
interval_spec, scheduler);
1106+
interval_spec);
11041107

11051108
} else {
11061109
for (GList *iter = scheduler->nodes; iter; iter = iter->next) {
11071110
pcmk_node_t *sched_node = iter->data;
11081111

11091112
rc = clear_rsc_failures(out, controld_api, sched_node, NULL,
1110-
operation, interval_spec, scheduler);
1113+
operation, interval_spec);
11111114
if (rc != pcmk_rc_ok) {
11121115
break;
11131116
}

0 commit comments

Comments
 (0)