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

Function log_action

pengine/utils.c:398–488  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

396
397
398void
399log_action(unsigned int log_level, const char *pre_text, action_t * action, gboolean details)
400{
401 const char *node_uname = NULL;
402 const char *node_uuid = NULL;
403
404 if (action == NULL) {
405 crm_trace("%s%s: <NULL>", pre_text == NULL ? "" : pre_text, pre_text == NULL ? "" : ": ");
406 return;
407 }
408
409 if (is_set(action->flags, pe_action_pseudo)) {
410 node_uname = NULL;
411 node_uuid = NULL;
412
413 } else if (action->node != NULL) {
414 node_uname = action->node->details->uname;
415 node_uuid = action->node->details->id;
416 } else {
417 node_uname = "<none>";
418 node_uuid = NULL;
419 }
420
421 switch (text2task(action->task)) {
422 case stonith_node:
423 case shutdown_crm:
424 crm_trace(
425 "%s%s%sAction %d: %s%s%s%s%s%s",
426 pre_text == NULL ? "" : pre_text,
427 pre_text == NULL ? "" : ": ",
428 is_set(action->flags,
429 pe_action_pseudo) ? "Pseduo " : is_set(action->flags,
430 pe_action_optional) ?
431 "Optional " : is_set(action->flags,
432 pe_action_runnable) ? is_set(action->flags,
433 pe_action_processed)
434 ? "" : "(Provisional) " : "!!Non-Startable!! ", action->id,
435 action->uuid, node_uname ? "\ton " : "",
436 node_uname ? node_uname : "", node_uuid ? "\t\t(" : "",
437 node_uuid ? node_uuid : "", node_uuid ? ")" : "");
438 break;
439 default:
440 crm_trace(
441 "%s%s%sAction %d: %s %s%s%s%s%s%s",
442 pre_text == NULL ? "" : pre_text,
443 pre_text == NULL ? "" : ": ",
444 is_set(action->flags,
445 pe_action_optional) ? "Optional " : is_set(action->flags,
446 pe_action_pseudo)
447 ? "Pseduo " : is_set(action->flags,
448 pe_action_runnable) ? is_set(action->flags,
449 pe_action_processed)
450 ? "" : "(Provisional) " : "!!Non-Startable!! ", action->id,
451 action->uuid, action->rsc?action->rsc->id:"<none>",
452 node_uname ? "\ton " : "", node_uname ? node_uname : "",
453 node_uuid ? "\t\t(" : "", node_uuid ? node_uuid : "",
454 node_uuid ? ")" : "");
455

Callers 2

should_dump_actionFunction · 0.85
do_calculationsFunction · 0.85

Calls 2

is_setFunction · 0.85
text2taskFunction · 0.85

Tested by

no test coverage detected