From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11795 invoked by alias); 11 May 2009 14:17:23 -0000 Received: (qmail 11784 invoked by alias); 11 May 2009 14:17:21 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS X-Spam-Check-By: sourceware.org X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bastion2.fedora.phx.redhat.com Subject: cluster: RHEL5 - fence_scsi_test.pl: #499871 fence_scsi_test.pl does not check for sg_persist in the path To: cluster-cvs-relay@redhat.com X-Project: Cluster Project X-Git-Module: cluster.git X-Git-Refname: refs/heads/RHEL5 X-Git-Reftype: branch X-Git-Oldrev: ee8d1b5915282b144ff5b74a0c2736b38c172274 X-Git-Newrev: 8154fa46818786e45cd158be649e99a112efa2da From: =?utf-8?q?Marek_Gr=C3=A1c?= Message-Id: <20090511135046.8E3FD1201EC@lists.fedorahosted.org> Date: Mon, 11 May 2009 14:17:00 -0000 X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 Mailing-List: contact cluster-cvs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: cluster-cvs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00247.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=8154fa46818786e45cd158be649e99a112efa2da Commit: 8154fa46818786e45cd158be649e99a112efa2da Parent: ee8d1b5915282b144ff5b74a0c2736b38c172274 Author: Marek 'marx' Grac AuthorDate: Mon May 11 15:41:25 2009 +0200 Committer: Marek 'marx' Grac 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;