diff --git a/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch b/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch new file mode 100644 index 0000000..68d2cda --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch @@ -0,0 +1,53 @@ +From 570e04d68c3595b137b104ba723aa2e6ceca5a3a Mon Sep 17 00:00:00 2001 +From: Reid Wahl +Date: Wed, 27 Jan 2021 01:45:43 -0800 +Subject: [PATCH] fence_redfish: Add diag action + +Sends NMI to fenced node. + +Ref: + - http://redfish.dmtf.org/schemas/DSP2046_2020.3.html#redfish.dmtf.org/schemas/v1/ComputerSystem.json|details|ResetType + +Resolves: RHBZ#1920947 + +Signed-off-by: Reid Wahl +--- + agents/redfish/fence_redfish.py | 6 ++++-- + tests/data/metadata/fence_redfish.xml | 1 + + 2 files changed, 5 insertions(+), 2 deletions(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index 1b259576..9a7d604d 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -40,7 +40,8 @@ def set_power_status(conn, options): + action = { + 'on' : "On", + 'off': "ForceOff", +- 'reboot': "ForceRestart" ++ 'reboot': "ForceRestart", ++ 'diag': "Nmi" + }[options["--action"]] + + payload = {'ResetType': action} +@@ -119,7 +120,8 @@ def define_new_opts(): + + def main(): + atexit.register(atexit_handler) +- device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", "ssl"] ++ device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", ++ "ssl", "diag"] + define_new_opts() + + opt = process_input(device_opt) +diff --git a/tests/data/metadata/fence_redfish.xml b/tests/data/metadata/fence_redfish.xml +index 6daf2cd9..fb112781 100644 +--- a/tests/data/metadata/fence_redfish.xml ++++ b/tests/data/metadata/fence_redfish.xml +@@ -187,5 +187,6 @@ + + + ++ + + diff --git a/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch b/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch new file mode 100644 index 0000000..3b328bb --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-2-add-diag-action-logic.patch @@ -0,0 +1,49 @@ +From b50523850e7fe1ba73d4ff0ede193c9860eff2bc Mon Sep 17 00:00:00 2001 +From: Oyvind Albrigtsen +Date: Fri, 7 May 2021 10:35:00 +0200 +Subject: [PATCH] fence_redfish: add missing diag logic + +--- + agents/redfish/fence_redfish.py | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index 9a7d604d3..0f5af523c 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -42,7 +42,7 @@ def set_power_status(conn, options): + 'off': "ForceOff", + 'reboot': "ForceRestart", + 'diag': "Nmi" +- }[options["--action"]] ++ }[options.get("original-action") or options["--action"]] + + payload = {'ResetType': action} + +@@ -56,6 +56,8 @@ def set_power_status(conn, options): + response = send_post_request(options, action_uri, payload) + if response['ret'] is False: + fail_usage("Error sending power command") ++ if options.get("original-action") == "diag": ++ return True + return + + def send_get_request(options, uri): +@@ -159,7 +161,16 @@ def main(): + else: + options["--systems-uri"] = sysresult["uri"] + +- result = fence_action(None, options, set_power_status, get_power_status, None) ++ reboot_fn = None ++ if options["--action"] == "diag": ++ # Diag is a special action that can't be verified so we will reuse reboot functionality ++ # to minimize impact on generic library ++ options["original-action"] = options["--action"] ++ options["--action"] = "reboot" ++ options["--method"] = "cycle" ++ reboot_fn = set_power_status ++ ++ result = fence_action(None, options, set_power_status, get_power_status, None, reboot_fn) + sys.exit(result) + + if __name__ == "__main__": diff --git a/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch b/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch new file mode 100644 index 0000000..24f49f3 --- /dev/null +++ b/SOURCES/bz1920947-fence_redfish-3-fix-typo.patch @@ -0,0 +1,22 @@ +From 753e126d0b642159b3e936de76a814f753f0d918 Mon Sep 17 00:00:00 2001 +From: Jeffrey Cutter +Date: Mon, 16 Nov 2020 14:29:30 -0500 +Subject: [PATCH] fence_redfish: Fix typo in help. + +--- + agents/redfish/fence_redfish.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py +index c7c6492c6..1b259576e 100644 +--- a/agents/redfish/fence_redfish.py ++++ b/agents/redfish/fence_redfish.py +@@ -102,7 +102,7 @@ def define_new_opts(): + all_opt["redfish-uri"] = { + "getopt" : ":", + "longopt" : "redfish-uri", +- "help" : "--redfish-uri=[uri] Base or starting Redifsh URI", ++ "help" : "--redfish-uri=[uri] Base or starting Redfish URI", + "required" : "0", + "default" : "/redfish/v1", + "shortdesc" : "Base or starting Redfish URI", diff --git a/SOURCES/bz1920947-fence_redfish-add-diag-action.patch b/SOURCES/bz1920947-fence_redfish-add-diag-action.patch deleted file mode 100644 index 68d2cda..0000000 --- a/SOURCES/bz1920947-fence_redfish-add-diag-action.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 570e04d68c3595b137b104ba723aa2e6ceca5a3a Mon Sep 17 00:00:00 2001 -From: Reid Wahl -Date: Wed, 27 Jan 2021 01:45:43 -0800 -Subject: [PATCH] fence_redfish: Add diag action - -Sends NMI to fenced node. - -Ref: - - http://redfish.dmtf.org/schemas/DSP2046_2020.3.html#redfish.dmtf.org/schemas/v1/ComputerSystem.json|details|ResetType - -Resolves: RHBZ#1920947 - -Signed-off-by: Reid Wahl ---- - agents/redfish/fence_redfish.py | 6 ++++-- - tests/data/metadata/fence_redfish.xml | 1 + - 2 files changed, 5 insertions(+), 2 deletions(-) - -diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py -index 1b259576..9a7d604d 100644 ---- a/agents/redfish/fence_redfish.py -+++ b/agents/redfish/fence_redfish.py -@@ -40,7 +40,8 @@ def set_power_status(conn, options): - action = { - 'on' : "On", - 'off': "ForceOff", -- 'reboot': "ForceRestart" -+ 'reboot': "ForceRestart", -+ 'diag': "Nmi" - }[options["--action"]] - - payload = {'ResetType': action} -@@ -119,7 +120,8 @@ def define_new_opts(): - - def main(): - atexit.register(atexit_handler) -- device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", "ssl"] -+ device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", -+ "ssl", "diag"] - define_new_opts() - - opt = process_input(device_opt) -diff --git a/tests/data/metadata/fence_redfish.xml b/tests/data/metadata/fence_redfish.xml -index 6daf2cd9..fb112781 100644 ---- a/tests/data/metadata/fence_redfish.xml -+++ b/tests/data/metadata/fence_redfish.xml -@@ -187,5 +187,6 @@ - - - -+ - - diff --git a/SPECS/fence-agents.spec b/SPECS/fence-agents.spec index 486a309..e1ad421 100644 --- a/SPECS/fence-agents.spec +++ b/SPECS/fence-agents.spec @@ -29,7 +29,7 @@ Name: fence-agents Summary: Set of unified programs capable of host isolation ("fencing") Version: 4.2.1 -Release: 70%{?alphatag:.%{alphatag}}%{?dist} +Release: 71%{?alphatag:.%{alphatag}}%{?dist} License: GPLv2+ and LGPLv2+ Group: System Environment/Base URL: https://github.com/ClusterLabs/fence-agents @@ -123,11 +123,13 @@ Patch81: bz1896827-fence_aws-add-imdsv2-support.patch Patch82: bz1914313-fence_zvmip-fix-disable-timeout.patch Patch83: bz1906978-fence_gce-default-to-onoff.patch Patch84: bz1925015-fence_ipmilan-add-fence_ipmilanplus.patch -Patch85: bz1920947-fence_redfish-add-diag-action.patch +Patch85: bz1920947-fence_redfish-1-add-diag-action.patch Patch86: bz1941989-fence_aws-add-filter-parameter.patch Patch87: bz1780825-fencing-1-add-stonith_status_sleep.patch Patch88: bz1780825-fencing-2-metadata-fix-long-parameters.patch Patch89: bz1942363-fence_gce-default-to-cycle.patch +Patch90: bz1920947-fence_redfish-2-add-diag-action-logic.patch +Patch91: bz1920947-fence_redfish-3-fix-typo.patch %if 0%{?fedora} || 0%{?rhel} > 7 %global supportedagents amt_ws apc apc_snmp bladecenter brocade cisco_mds cisco_ucs compute drac5 eaton_snmp emerson eps evacuate hds_cb hpblade ibmblade ifmib ilo ilo_moonshot ilo_mp ilo_ssh intelmodular ipdu ipmilan kdump lpar mpath redfish rhevm rsa rsb sbd scsi vmware_rest vmware_soap wti @@ -295,6 +297,8 @@ BuildRequires: python3-google-api-client %patch87 -p1 %patch88 -p1 %patch89 -p1 +%patch90 -p1 +%patch91 -p1 # prevent compilation of something that won't get used anyway sed -i.orig 's|FENCE_ZVM=1|FENCE_ZVM=0|' configure.ac @@ -1185,6 +1189,10 @@ Fence agent for IBM z/VM over IP. %endif %changelog +* Fri May 7 2021 Oyvind Albrigtsen - 4.2.1-71 +- fence_redfish: add diag action + Resolves: rhbz#1920947 + * Thu May 6 2021 Oyvind Albrigtsen - 4.2.1-70 - fence_gce: change default back to cycle to avoid "soft" off Resolves: rhbz#1942363 @@ -1203,8 +1211,6 @@ Fence agent for IBM z/VM over IP. Resolves: rhbz#1726874 - fence_ipmilanplus: new symlink agent with lanplus enabled by default Resolves: rhbz#1925015 -- fence_redfish: add diag action - Resolves: rhbz#1920947 * Tue Feb 2 2021 Oyvind Albrigtsen - 4.2.1-65 - fence_gce: default to onoff