[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Cluster-devel] [PATCH] 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]