From: <dba...@us...> - 2011-03-17 03:59:04
|
Revision: 215 http://devmon.svn.sourceforge.net/devmon/?rev=215&view=rev Author: dbaldwin Date: 2011-03-17 03:58:58 +0000 (Thu, 17 Mar 2011) Log Message: ----------- clean up quoting of curly braces in s// Modified Paths: -------------- trunk/modules/dm_tests.pm Modified: trunk/modules/dm_tests.pm =================================================================== --- trunk/modules/dm_tests.pm 2011-01-25 13:54:36 UTC (rev 214) +++ trunk/modules/dm_tests.pm 2011-03-17 03:58:58 UTC (rev 215) @@ -473,7 +473,7 @@ my @repeaters; for my $dep_oid (@dep_oids) { push @repeaters, $dep_oid and next if $oids->{$dep_oid}{'repeat'}; - $expr =~ s/\{$dep_oid}/$oids->{$dep_oid}{'val'}/g; + $expr =~ s/\{$dep_oid\}/$oids->{$dep_oid}{'val'}/g; } # Handle repeater-type oids @@ -482,7 +482,7 @@ # Sure, we could just do a regsub for every dep_oid on every leaf, but # thats pretty expensive CPU-wise for (my $i = 0; $i <= $#repeaters; $i++) { - $expr =~ s/\{$repeaters[$i]}/\$dep_val[$i]/g; + $expr =~ s/\{$repeaters[$i]\}/\$dep_val[$i]/g; } for my $leaf (keys %{$oids->{$oid_h->{'pri_oid'}}{'val'}}) { @@ -1454,7 +1454,7 @@ my @repeaters; for my $dep_oid (@dep_oids) { push @repeaters, $dep_oid and next if $oids->{$dep_oid}{'repeat'}; - $expr =~ s/\{$dep_oid}/$oids->{$dep_oid}{'val'}/g; + $expr =~ s/\{$dep_oid\}/$oids->{$dep_oid}{'val'}/g; } # See if we are a repeating variable type datum @@ -1463,7 +1463,7 @@ # Map the names of our repeater oids to a position on a placeholder array for (my $i = 0; $i <= $#repeaters; $i++) { - $expr =~ s/\{$repeaters[$i]}/\$dep_val[$i]/g; + $expr =~ s/\{$repeaters[$i]\}/\$dep_val[$i]/g; } for my $leaf (keys %{$oids->{$oid_h->{'pri_oid'}}{'val'}}) { @@ -1932,7 +1932,7 @@ if($flag eq 'color') { # Honor the 'alarm' exceptions - $row_data =~ s/\{$root}/&$color /; + $row_data =~ s/\{$root\}/&$color /; # If this test has a worse color, use it for the global color $worst_color = $color if !defined $worst_color or @@ -1943,13 +1943,13 @@ elsif ($flag eq 'msg') { my $substr = $oid_h->{'msg'}{$leaf}; $substr = 'Undefined' if !defined $substr; - $row_data =~ s/\{$root}/$substr/; + $row_data =~ s/\{$root\}/$substr/; } # This flag only causes errors (with the color) to be displayed # Will also modify global color type elsif ($flag eq 'errors') { - $row_data =~ s/\{$root}//; + $row_data =~ s/\{$root\}//; next if $color eq 'green'; @@ -1974,7 +1974,7 @@ $oids->{$oid}{'thresh'}{$th_col}{'val'}; $thresh = 'Undefined' if !defined $thresh; - $row_data =~ s/\{$root}/$thresh/; + $row_data =~ s/\{$root\}/$thresh/; } # Uknown flag @@ -1987,7 +1987,7 @@ else { my $substr = $oids->{$root}{'repeat'} ? $oids->{$root}{'val'}{$leaf} : $oids->{$root}{'val'}; $substr = 'Undefined' if !defined $substr; - $row_data =~ s/\{$root}/$substr/; + $row_data =~ s/\{$root\}/$substr/; } } @@ -2090,20 +2090,20 @@ # If this test has a worse color, use it for the global color $worst_color = $color if !defined $worst_color or $colors{$worst_color} < $colors{$color}; - $line =~ s/\{$root}/\&$color /; + $line =~ s/\{$root\}/\&$color /; } elsif ($flag eq 'msg') { my $data = $oid_h->{'msg'}; $data = "Undefined" if !defined $data; $data = parse_deps($oids, $data, undef); - $line =~ s/\{$root}/$data/; + $line =~ s/\{$root\}/$data/; } # This flag only causes errors (with the color) to be displayed # Can also modifies global color elsif ($flag eq 'errors') { - $line =~ s/\{$root}/#ERRORONLY#/; + $line =~ s/\{$root\}/#ERRORONLY#/; # Skip this value if it is green next if !defined $color or $color eq 'green'; @@ -2128,7 +2128,7 @@ $oids->{$oid}{'thresh'}{$th_col}{'val'}; $thresh = 'Undefined' if !defined $thresh; - $line =~ s/\{$root}/$thresh/; + $line =~ s/\{$root\}/$thresh/; } # Unknown flag @@ -2142,7 +2142,7 @@ my $val = $oid_h->{'val'}; $val = "Unknown" if !defined $val; - $line =~ s/\{$root}/$val/; + $line =~ s/\{$root\}/$val/; } } @@ -2306,7 +2306,7 @@ } } - $msg =~ s/\{$dep_oid}/$val/g; + $msg =~ s/\{$dep_oid\}/$val/g; } return $msg; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |