From abb6feeb39c027aa0c3f973ef93e3524ea866936 Mon Sep 17 00:00:00 2001 From: Klaus Wenninger Date: Mon, 21 Jan 2019 13:40:44 +0100 Subject: [PATCH] Fix: crm_mon: remove duplicity of fence-action-state in xml-output and unnecessary conditionals making code less readable that were probably introduced rearranging the code. rhbz#1667191 --- tools/crm_mon.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/tools/crm_mon.c b/tools/crm_mon.c index aad9b719b4..bc161aac33 100644 --- a/tools/crm_mon.c +++ b/tools/crm_mon.c @@ -3175,7 +3175,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event) fprintf(stream, " completed=\"%s\"", run_at_s?run_at_s:""); break; default: - fprintf(stream, " state=\"pending\""); + break; } fprintf(stream, " />\n"); break; @@ -3189,8 +3189,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event) action_s, event->target, event->delegate ? event->delegate : "", event->client, event->origin, - ((!fence_full_history) && (output_format != mon_output_xml))? - "last-successful":"completed", + fence_full_history?"completed":"last-successful", run_at_s?run_at_s:""); break; case st_failed: @@ -3199,8 +3198,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event) action_s, event->target, event->delegate ? event->delegate : "", event->client, event->origin, - ((!fence_full_history) && (output_format != mon_output_xml))? - "last-failed":"completed", + fence_full_history?"completed":"last-failed", run_at_s?run_at_s:""); break; default: @@ -3219,9 +3217,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event) action_s, event->target, event->delegate ? event->delegate : "", event->client, event->origin, - ((!fence_full_history) && - (output_format != mon_output_xml))? - "last-successful":"completed", + fence_full_history?"completed":"last-successful", run_at_s?run_at_s:""); break; case st_failed: @@ -3230,9 +3226,7 @@ print_stonith_action(FILE *stream, stonith_history_t *event) action_s, event->target, event->delegate ? event->delegate : "", event->client, event->origin, - ((!fence_full_history) && - (output_format != mon_output_xml))? - "last-failed":"completed", + fence_full_history?"completed":"last-failed", run_at_s?run_at_s:""); break; default: