fence-agents/SOURCES/bz2134015-fence_lpar-only-output-additional-info-on-debug.patch
2023-05-09 06:38:13 +00:00

34 lines
1.2 KiB
Diff

From 46f94d4dbad868afc70b96bd612323221991d06e Mon Sep 17 00:00:00 2001
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
Date: Tue, 11 Oct 2022 09:51:24 +0200
Subject: [PATCH] fence_lpar: only output additional error output on DEBUG
level
Without this patch we get ERROR logged with trace info when doing
status-action for nodes that doesnt exist.
---
agents/lpar/fence_lpar.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/agents/lpar/fence_lpar.py b/agents/lpar/fence_lpar.py
index 2046b0e4e..975971a57 100644
--- a/agents/lpar/fence_lpar.py
+++ b/agents/lpar/fence_lpar.py
@@ -12,6 +12,7 @@
import sys, re
import atexit
+import logging
sys.path.append("@FENCEAGENTSLIBDIR@")
from fencing import *
from fencing import fail, fail_usage, EC_STATUS_HMC
@@ -48,7 +49,7 @@ def get_power_status(conn, options):
elif options["--hmc-version"] in ["4", "IVM"]:
status = re.compile(",state=(.*?),", re.IGNORECASE).search(conn.before).group(1)
except AttributeError as e:
- fail_usage("Command on HMC failed: {}\n{}".format(command, str(e)), False)
+ logging.debug("Command on HMC failed: {}\n{}".format(command, str(e)))
fail(EC_STATUS_HMC)
return _normalize_status(status)