Blame SOURCES/bz2160478-fence_scsi-fix-validate-all.patch

66972f
From a416a367a804f1e5abaf142c629fe6ab5572d3b6 Mon Sep 17 00:00:00 2001
66972f
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
66972f
Date: Thu, 12 Jan 2023 15:46:41 +0100
66972f
Subject: [PATCH] fence_scsi: skip key generation during validate-all action
66972f
66972f
---
66972f
 agents/scsi/fence_scsi.py | 9 +++++----
66972f
 1 file changed, 5 insertions(+), 4 deletions(-)
66972f
66972f
diff --git a/agents/scsi/fence_scsi.py b/agents/scsi/fence_scsi.py
66972f
index e33339614..f9e6823b2 100644
66972f
--- a/agents/scsi/fence_scsi.py
66972f
+++ b/agents/scsi/fence_scsi.py
66972f
@@ -566,11 +566,12 @@ def main():
66972f
 	or ("--key" in options and options["--key"])):
66972f
 		fail_usage("Failed: nodename or key is required", stop_after_error)
66972f
 
66972f
-	if not ("--key" in options and options["--key"]):
66972f
-		options["--key"] = generate_key(options)
66972f
+	if options["--action"] != "validate-all":
66972f
+		if not ("--key" in options and options["--key"]):
66972f
+			options["--key"] = generate_key(options)
66972f
 
66972f
-	if options["--key"] == "0" or not options["--key"]:
66972f
-		fail_usage("Failed: key cannot be 0", stop_after_error)
66972f
+		if options["--key"] == "0" or not options["--key"]:
66972f
+			fail_usage("Failed: key cannot be 0", stop_after_error)
66972f
 
66972f
 	if "--key-value" in options\
66972f
 	and (options["--key-value"] != "id" and options["--key-value"] != "hash"):