This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: RHEL5 - fence_scsi_test.pl: #499871 fence_scsi_test.pl doesnot check for sg_persist in the path


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8154fa46818786e45cd158be649e99a112efa2da
Commit:        8154fa46818786e45cd158be649e99a112efa2da
Parent:        ee8d1b5915282b144ff5b74a0c2736b38c172274
Author:        Marek 'marx' Grac <mgrac@redhat.com>
AuthorDate:    Mon May 11 15:41:25 2009 +0200
Committer:     Marek 'marx' Grac <mgrac@redhat.com>
CommitterDate: Mon May 11 15:41:25 2009 +0200

fence_scsi_test.pl: #499871 fence_scsi_test.pl does not check for sg_persist in the path

---
 fence/agents/scsi/fence_scsi_test.pl |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi_test.pl b/fence/agents/scsi/fence_scsi_test.pl
index 35bea49..59e65f9 100755
--- a/fence/agents/scsi/fence_scsi_test.pl
+++ b/fence/agents/scsi/fence_scsi_test.pl
@@ -187,8 +187,23 @@ sub print_usage
     print "  -h     Help. Prints out this usage information.\n\n";
 }
 
+sub test_tools_path
+{
+    my $tool_name = "sg_persist";
+    
+    for my $path ( split /:/, $ENV{PATH} ) {
+        if ( -f "$path/$tool_name" && -x _ ) {
+          return;
+        }
+    }
+    
+    die "No $tool_name command available, please install the sg3_utils package.\n"
+}
+
 ### MAIN #######################################################################
 
+test_tools_path;
+
 if (getopts("cdhst:v") == 0)
 {
     print_usage;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]