pacemaker/00-Fix-crm_mon-remove-duplicity-of-fence-action-state-i.patch
Jan Pokorný 885ffa47ae
2.0.1-0.2.rc3 - Fix buildability with GCC 9 (PR #1681)
Apply minor crm_mon XML output fix (PR #1678)

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2019-01-22 13:34:01 +01:00

70 lines
3.5 KiB
Diff

From abb6feeb39c027aa0c3f973ef93e3524ea866936 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
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: