RHEL5 - fence_scsi.pl: check if nodeid is zero

Ryan O'Hara rohara@fedoraproject.org
Thu Sep 4 21:36:00 GMT 2008


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=25a0181f94420fefa311a471209ba2babd0bfdee
Commit:        25a0181f94420fefa311a471209ba2babd0bfdee
Parent:        dc3e8ec19305820c424eff6439e827231cbc44e9
Author:        rohara <rohara@spartan.(none)>
AuthorDate:    Thu Sep 4 16:25:56 2008 -0500
Committer:     rohara <rohara@spartan.(none)>
CommitterDate: Thu Sep 4 16:25:56 2008 -0500

fence_scsi.pl: check if nodeid is zero

If the nodeid we get from the XML query of cluster.conf is zero,
then either the node does not exist in the cluster of the nodeid
is not set. Each case is invalid, so report an error and exit.
---
 fence/agents/scsi/fence_scsi.pl |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 5074af3..a1e5246 100755
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -187,6 +187,10 @@ sub get_key
     my $cluster_id = get_cluster_id;
     my $node_id = get_node_id($node);
 
+    if ($node_id == 0) {
+	die "Unable to determine nodeid for $node.\n";
+    }
+
     my $key = sprintf "%x%.4x", $cluster_id, $node_id;
 
     return $key;



More information about the Cluster-cvs mailing list