From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22377 invoked by alias); 11 May 2009 13:52:16 -0000 Received: (qmail 22371 invoked by alias); 11 May 2009 13:52:16 -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: STABLE3 - 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/STABLE3 X-Git-Reftype: branch X-Git-Oldrev: e50209054eca1755930300d9c3f904b37fcf3ac5 X-Git-Newrev: 7e6ec0be8f368c2991c1aabff27d39d63adb9486 From: =?utf-8?q?Marek_Gr=C3=A1c?= Message-Id: <20090511135150.2988D1201EC@lists.fedorahosted.org> Date: Mon, 11 May 2009 13:52: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/msg00243.txt.bz2 Gitweb: http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=7e6ec0be8f368c2991c1aabff27d39d63adb9486 Commit: 7e6ec0be8f368c2991c1aabff27d39d63adb9486 Parent: e50209054eca1755930300d9c3f904b37fcf3ac5 Author: Marek 'marx' Grac AuthorDate: Mon May 11 15:41:25 2009 +0200 Committer: Marek 'marx' Grac CommitterDate: Mon May 11 15:48:55 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 357a824..cba3c21 100644 --- a/fence/agents/scsi/fence_scsi_test.pl +++ b/fence/agents/scsi/fence_scsi_test.pl @@ -175,8 +175,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;