Blame SOURCES/bz1920947-fence_redfish-1-add-diag-action.patch

2107d2
From 570e04d68c3595b137b104ba723aa2e6ceca5a3a Mon Sep 17 00:00:00 2001
2107d2
From: Reid Wahl <nrwahl@protonmail.com>
2107d2
Date: Wed, 27 Jan 2021 01:45:43 -0800
2107d2
Subject: [PATCH] fence_redfish: Add diag action
2107d2
2107d2
Sends NMI to fenced node.
2107d2
2107d2
Ref:
2107d2
  - http://redfish.dmtf.org/schemas/DSP2046_2020.3.html#redfish.dmtf.org/schemas/v1/ComputerSystem.json|details|ResetType
2107d2
2107d2
Resolves: RHBZ#1920947
2107d2
2107d2
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
2107d2
---
2107d2
 agents/redfish/fence_redfish.py       | 6 ++++--
2107d2
 tests/data/metadata/fence_redfish.xml | 1 +
2107d2
 2 files changed, 5 insertions(+), 2 deletions(-)
2107d2
2107d2
diff --git a/agents/redfish/fence_redfish.py b/agents/redfish/fence_redfish.py
2107d2
index 1b259576..9a7d604d 100644
2107d2
--- a/agents/redfish/fence_redfish.py
2107d2
+++ b/agents/redfish/fence_redfish.py
2107d2
@@ -40,7 +40,8 @@ def set_power_status(conn, options):
2107d2
     action = {
2107d2
         'on' : "On",
2107d2
         'off': "ForceOff",
2107d2
-        'reboot': "ForceRestart"
2107d2
+        'reboot': "ForceRestart",
2107d2
+        'diag': "Nmi"
2107d2
     }[options["--action"]]
2107d2
 
2107d2
     payload = {'ResetType': action}
2107d2
@@ -119,7 +120,8 @@ def define_new_opts():
2107d2
 
2107d2
 def main():
2107d2
     atexit.register(atexit_handler)
2107d2
-    device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri", "ssl"]
2107d2
+    device_opt = ["ipaddr", "login", "passwd", "redfish-uri", "systems-uri",
2107d2
+                  "ssl", "diag"]
2107d2
     define_new_opts()
2107d2
 
2107d2
     opt = process_input(device_opt)
2107d2
diff --git a/tests/data/metadata/fence_redfish.xml b/tests/data/metadata/fence_redfish.xml
2107d2
index 6daf2cd9..fb112781 100644
2107d2
--- a/tests/data/metadata/fence_redfish.xml
2107d2
+++ b/tests/data/metadata/fence_redfish.xml
2107d2
@@ -187,5 +187,6 @@
2107d2
 	<action name="metadata" />
2107d2
 	<action name="manpage" />
2107d2
 	<action name="validate-all" />
2107d2
+	<action name="diag" />
2107d2
 </actions>
2107d2
 </resource-agent>