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

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