Blame SOURCES/bz1647522-fence_scsi-fix-incorrect-SCSI-key-node-ID-10-or-higher.patch

552e8d
From f77297b654586bf539e78957f26cae1d22c6f081 Mon Sep 17 00:00:00 2001
552e8d
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
552e8d
Date: Fri, 2 Nov 2018 09:24:56 +0100
552e8d
Subject: [PATCH] fence_scsi: fix incorrect SCSI key when node ID is 10 or
552e8d
 higher
552e8d
552e8d
  The last four digits of the SCSI key will be zero padded digit between 0000-0009.
552e8d
---
552e8d
 agents/scsi/fence_scsi.py | 2 +-
552e8d
 1 file changed, 1 insertion(+), 1 deletion(-)
552e8d
552e8d
diff --git a/agents/scsi/fence_scsi.py b/agents/scsi/fence_scsi.py
552e8d
index 2180d0c9..79ada4fa 100644
552e8d
--- a/agents/scsi/fence_scsi.py
552e8d
+++ b/agents/scsi/fence_scsi.py
552e8d
@@ -191,7 +191,7 @@ def get_cluster_id(options):
552e8d
 def get_node_id(options):
552e8d
 	cmd = options["--corosync-cmap-path"] + " nodelist"
552e8d
 
552e8d
-	match = re.search(r".(\d).ring._addr \(str\) = " + options["--plug"] + "\n", run_cmd(options, cmd)["out"])
552e8d
+	match = re.search(r".(\d+).ring._addr \(str\) = " + options["--plug"] + "\n", run_cmd(options, cmd)["out"])
552e8d
 	return match.group(1) if match else fail_usage("Failed: unable to parse output of corosync-cmapctl or node does not exist")
552e8d
 
552e8d