summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-03-28 08:32:11 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-03-28 08:32:11 -0700
commit6848fbee522dee4d01f49b9354ad0b728ebce516 (patch)
tree7889726c7f5db97ca66f4129d938dfa231559be2
parent5badee4290bd825484d563858f363893424b3f92 (diff)
downloadvyatta-cfg-6848fbee522dee4d01f49b9354ad0b728ebce516.tar.gz
vyatta-cfg-6848fbee522dee4d01f49b9354ad0b728ebce516.zip
Fix perlcritic warnings
Don't explicitly return undef. Also no need to test for file existance, then open it. Just do open, and if that fails file does not exist.
-rwxr-xr-xlib/Vyatta/Config.pm5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm
index df4d20f..58dd7ea 100755
--- a/lib/Vyatta/Config.pm
+++ b/lib/Vyatta/Config.pm
@@ -738,8 +738,9 @@ sub parseTmplAll {
my %ret = ();
my $tpath = $self->getTmplPath(\@pdirs);
return unless $tpath;
- return undef if (! -r "$tpath/node.def");
- open(my $tmpl, '<', "$tpath/node.def") or return undef;
+
+ open(my $tmpl, '<', "$tpath/node.def")
+ or return;
foreach (<$tmpl>) {
if (/^multi:/) {
$ret{multi} = 1;