]> git.proxmox.com Git - pve-storage.git/commitdiff
fix modification of read only bug
authorMichael Rasmussen <mir@datanom.net>
Fri, 24 Oct 2014 22:16:32 +0000 (00:16 +0200)
committerDietmar Maurer <dietmar@proxmox.com>
Sat, 25 Oct 2014 07:46:28 +0000 (09:46 +0200)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
PVE/Storage/LunCmd/Istgt.pm

index c17d1c89e8865a57afd40a467e03de5a5676da01..8594f77894db5e215f23ad4f8c57a721fdb4f46a 100644 (file)
@@ -241,7 +241,7 @@ my $make_lun = sub {
     my @options = ();
     my $lun = $get_lu_name->($target);
     if ($scfg->{nowritecache}) {
-        push @options, "WriteCache Disable";     
+        push @options, "WriteCache Disable";
     }
     my $conf = {
         lun => $lun,
@@ -285,13 +285,14 @@ my $parser = sub {
             next if (($_ =~ /^\s*#/) || ($_ =~ /^\s*$/));
             if ($_ =~ /^\s*(\w+)\s+(.+)\s*/) {
                 my $arg1 = $1;
-                $2 =~ s/^\s+|\s+$|"\s*//g;
-                if ($2 =~ /^Storage\s*(.+)/i) {
+                my $arg2 = $2;
+                $arg2 =~ s/^\s+|\s+$|"\s*//g;
+                if ($arg2 =~ /^Storage\s*(.+)/i) {
                     $SETTINGS->{$lun}->{$arg1}->{storage} = $1;
-                } elsif ($2 =~ /^Option\s*(.+)/i) {
+                } elsif ($arg2 =~ /^Option\s*(.+)/i) {
                     push @{$SETTINGS->{$lun}->{$arg1}->{options}}, $1;
                 } else {
-                    $SETTINGS->{$lun}->{$arg1} = $2;
+                    $SETTINGS->{$lun}->{$arg1} = $arg2;
                 }
             } else {
                 die "$line: parse error [$_]";