FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Cluster Development

 
 
LinkBack Thread Tools
 
Old 03-15-2011, 07:22 PM
"Ryan O'Hara"
 
Default fence_scsi: grep for keys should be case insensitive

When checking that a key is or is not registered for a device, the key
comparison should be case insensitive. Using sg_persist to query for
registered keys will always give lowercase characters for hexadecimal
keys, so registering key 'A' would appear to fail since it would not
match 'a'.

Resolves: rhbz#653504

Signed-off-by: Ryan O'Hara <rohara@redhat.com>
---
fence/agents/scsi/fence_scsi.pl | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fence/agents/scsi/fence_scsi.pl b/fence/agents/scsi/fence_scsi.pl
index 14b0784..2751bed 100644
--- a/fence/agents/scsi/fence_scsi.pl
+++ b/fence/agents/scsi/fence_scsi.pl
@@ -73,7 +73,7 @@ sub do_action_off ($@)
log_error ("device $dev does not exist") if (! -e $dev);
log_error ("device $dev is not a block device") if (! -b $dev);

- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);

if (scalar (@keys) != 0) {
do_preempt_abort ($host_key, $node_key, $dev);
@@ -97,7 +97,7 @@ sub do_action_status ($@)

do_reset ($dev);

- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);

if (scalar (@keys) != 0) {
$dev_count++;
@@ -119,7 +119,7 @@ sub do_verify_on ($@)
my $count = 0;

for $dev (@devices) {
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);

## check that our key is registered
if (scalar (@keys) == 0) {
@@ -150,7 +150,7 @@ sub do_verify_off ($@)
my $count = 0;

for $dev (@devices) {
- my @keys = grep { /^$node_key$/ } get_registration_keys ($dev);
+ my @keys = grep { /^$node_key$/i } get_registration_keys ($dev);

## check that our key is not registered
if (scalar (@keys) != 0) {
--
1.7.3.4
 

Thread Tools




All times are GMT. The time now is 02:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org