|
|
36923b |
From d6294dd28b6d95ad3844824996717f9959d97ac6 Mon Sep 17 00:00:00 2001
|
|
|
36923b |
From: Reid Wahl <nrwahl@protonmail.com>
|
|
|
36923b |
Date: Thu, 30 Jun 2022 11:07:32 -0700
|
|
|
36923b |
Subject: [PATCH 1/2] Fix: Use correct boolean in stonith__validate_agent_xml
|
|
|
36923b |
|
|
|
36923b |
This fixes a regression introduced by 91a2b2e that flips the boolean
|
|
|
36923b |
values for "valid" in the XML output.
|
|
|
36923b |
|
|
|
36923b |
Resolves: RHBZ#2102292 (partial)
|
|
|
36923b |
|
|
|
36923b |
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
|
|
|
36923b |
---
|
|
|
36923b |
lib/fencing/st_output.c | 7 +++----
|
|
|
36923b |
1 file changed, 3 insertions(+), 4 deletions(-)
|
|
|
36923b |
|
|
|
36923b |
diff --git a/lib/fencing/st_output.c b/lib/fencing/st_output.c
|
|
|
36923b |
index e0ff848c2..eb10ad0c5 100644
|
|
|
36923b |
--- a/lib/fencing/st_output.c
|
|
|
36923b |
+++ b/lib/fencing/st_output.c
|
|
|
36923b |
@@ -528,10 +528,9 @@ validate_agent_xml(pcmk__output_t *out, va_list args) {
|
|
|
36923b |
char *error_output = va_arg(args, char *);
|
|
|
36923b |
int rc = va_arg(args, int);
|
|
|
36923b |
|
|
|
36923b |
- xmlNodePtr node = pcmk__output_create_xml_node(out, "validate",
|
|
|
36923b |
- "agent", agent,
|
|
|
36923b |
- "valid", pcmk__btoa(rc),
|
|
|
36923b |
- NULL);
|
|
|
36923b |
+ xmlNodePtr node = pcmk__output_create_xml_node(
|
|
|
36923b |
+ out, "validate", "agent", agent, "valid", pcmk__btoa(rc == pcmk_ok),
|
|
|
36923b |
+ NULL);
|
|
|
36923b |
|
|
|
36923b |
if (device != NULL) {
|
|
|
36923b |
crm_xml_add(node, "device", device);
|
|
|
36923b |
--
|
|
|
36923b |
2.31.1
|
|
|
36923b |
|
|
|
36923b |
|
|
|
36923b |
From 81e83683e69b4f147f40f5353f8e68032758a104 Mon Sep 17 00:00:00 2001
|
|
|
36923b |
From: Reid Wahl <nrwahl@protonmail.com>
|
|
|
36923b |
Date: Wed, 29 Jun 2022 18:15:33 -0700
|
|
|
36923b |
Subject: [PATCH 2/2] Fix: Use failed action result in rhcs_validate and
|
|
|
36923b |
_get_metadata
|
|
|
36923b |
|
|
|
36923b |
If an action failed but has a non-NULL result, get the rc and other
|
|
|
36923b |
attributes from that result.
|
|
|
36923b |
|
|
|
36923b |
This fixes a regression introduced by b441925, in which failure XML
|
|
|
36923b |
output now contains a CRM_EX_CONNECTED rc instead of the correct one and
|
|
|
36923b |
does not contain stdout/stderr. That commit caused
|
|
|
36923b |
services__execute_file() to return a proper rc instead of TRUE. A
|
|
|
36923b |
non-pcmk_ok bubbled up the call chain causing
|
|
|
36923b |
internal_stonith_action_execute() to return -ECONNABORTED. Then
|
|
|
36923b |
rhcs_validate() and _get_metadata() would use this rc instead of the one
|
|
|
36923b |
attached to the result.
|
|
|
36923b |
|
|
|
36923b |
Resolves: RHBZ#2102292
|
|
|
36923b |
|
|
|
36923b |
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
|
|
|
36923b |
---
|
|
|
36923b |
lib/fencing/st_rhcs.c | 10 +++++-----
|
|
|
36923b |
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
36923b |
|
|
|
36923b |
diff --git a/lib/fencing/st_rhcs.c b/lib/fencing/st_rhcs.c
|
|
|
36923b |
index 39485013e..029c97eea 100644
|
|
|
36923b |
--- a/lib/fencing/st_rhcs.c
|
|
|
36923b |
+++ b/lib/fencing/st_rhcs.c
|
|
|
36923b |
@@ -130,16 +130,15 @@ stonith__rhcs_get_metadata(const char *agent, int timeout, xmlNode **metadata)
|
|
|
36923b |
stonith_action_t *action = stonith_action_create(agent, "metadata", NULL, 0,
|
|
|
36923b |
5, NULL, NULL, NULL);
|
|
|
36923b |
int rc = stonith__execute(action);
|
|
|
36923b |
+ result = stonith__action_result(action);
|
|
|
36923b |
|
|
|
36923b |
- if (rc < 0) {
|
|
|
36923b |
+ if (rc < 0 && result == NULL) {
|
|
|
36923b |
crm_warn("Could not execute metadata action for %s: %s "
|
|
|
36923b |
CRM_XS " rc=%d", agent, pcmk_strerror(rc), rc);
|
|
|
36923b |
stonith__destroy_action(action);
|
|
|
36923b |
return rc;
|
|
|
36923b |
}
|
|
|
36923b |
|
|
|
36923b |
- result = stonith__action_result(action);
|
|
|
36923b |
-
|
|
|
36923b |
if (result->execution_status != PCMK_EXEC_DONE) {
|
|
|
36923b |
crm_warn("Could not execute metadata action for %s: %s",
|
|
|
36923b |
agent, pcmk_exec_status_str(result->execution_status));
|
|
|
36923b |
@@ -262,6 +261,7 @@ stonith__rhcs_validate(stonith_t *st, int call_options, const char *target,
|
|
|
36923b |
int remaining_timeout = timeout;
|
|
|
36923b |
xmlNode *metadata = NULL;
|
|
|
36923b |
stonith_action_t *action = NULL;
|
|
|
36923b |
+ pcmk__action_result_t *result = NULL;
|
|
|
36923b |
|
|
|
36923b |
if (host_arg == NULL) {
|
|
|
36923b |
time_t start_time = time(NULL);
|
|
|
36923b |
@@ -298,9 +298,9 @@ stonith__rhcs_validate(stonith_t *st, int call_options, const char *target,
|
|
|
36923b |
NULL, host_arg);
|
|
|
36923b |
|
|
|
36923b |
rc = stonith__execute(action);
|
|
|
36923b |
- if (rc == pcmk_ok) {
|
|
|
36923b |
- pcmk__action_result_t *result = stonith__action_result(action);
|
|
|
36923b |
+ result = stonith__action_result(action);
|
|
|
36923b |
|
|
|
36923b |
+ if (result != NULL) {
|
|
|
36923b |
rc = pcmk_rc2legacy(stonith__result2rc(result));
|
|
|
36923b |
|
|
|
36923b |
// Take ownership of output so stonith__destroy_action() doesn't free it
|
|
|
36923b |
--
|
|
|
36923b |
2.31.1
|
|
|
36923b |
|