Skip to content

Commit

Permalink
Merge pull request ClusterLabs#273 from oalbrigt/fence_scsi-detect-no…
Browse files Browse the repository at this point in the history
…deid-new-format

fence_scsi: detect node ID using new format, and fallback to old format before failing
  • Loading branch information
oalbrigt authored May 23, 2019
2 parents e462fa5 + 1c4a64c commit 5f79f9e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion agents/scsi/fence_scsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,14 @@ def get_cluster_id(options):

def get_node_id(options):
cmd = options["--corosync-cmap-path"] + " nodelist"
out = run_cmd(options, cmd)["out"]

match = re.search(r".(\d+).name \(str\) = " + options["--plug"] + "\n", out)

# try old format before failing
if not match:
match = re.search(r".(\d+).ring._addr \(str\) = " + options["--plug"] + "\n", out)

match = re.search(r".(\d+).ring._addr \(str\) = " + options["--plug"] + "\n", run_cmd(options, cmd)["out"])
return match.group(1) if match else fail_usage("Failed: unable to parse output of corosync-cmapctl or node does not exist")


Expand Down

0 comments on commit 5f79f9e

Please sign in to comment.