diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-20 17:32:19 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2007-12-20 17:32:19 -0800 |
commit | aac164fc48911b10e09b8d562e21aef90bad9699 (patch) | |
tree | 93f87f39e9bb9a15bb760fdf8385654bd80f2b7d /scripts/VyattaConfig.pm | |
parent | 68df52c1edbf843e6fb56de3578f18fba80799c4 (diff) | |
download | vyatta-cfg-aac164fc48911b10e09b8d562e21aef90bad9699.tar.gz vyatta-cfg-aac164fc48911b10e09b8d562e21aef90bad9699.zip |
Some checks for undefined references
Diffstat (limited to 'scripts/VyattaConfig.pm')
-rw-r--r-- | scripts/VyattaConfig.pm | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/scripts/VyattaConfig.pm b/scripts/VyattaConfig.pm index 6f99329..3a24579 100644 --- a/scripts/VyattaConfig.pm +++ b/scripts/VyattaConfig.pm @@ -190,8 +190,8 @@ sub returnOrigValue { # node is relative sub returnValues { my $val = returnValue(@_); - my @values; - if ($val) { + my @values = (); + if (defined($val)) { @values = split("\n", $val); } return @values; @@ -317,17 +317,16 @@ sub listNodeStatus { my ($self, $path) = @_; my @nodes = (); my %nodehash = (); - my $node = undef; # find deleted nodes first @nodes = $self->listDeleted("$path"); - foreach $node (@nodes) { + foreach my $node (@nodes) { if ($node =~ /.+/) { $nodehash{$node} = "deleted" }; } @nodes = (); @nodes = $self->listNodes("$path"); - foreach $node (@nodes) { + foreach my $node (@nodes) { if ($node =~ /.+/) { #print "DEBUG VyattaConfig->listNodeStatus(): node $node\n"; # No deleted nodes -- added, changed, ot static only. |