From 9e84035a42dcc335d9799256d7f465c3e3277500 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 9 Jun 2010 14:33:41 -0700 Subject: fix another default value display problem --- lib/Vyatta/Config.pm | 2 +- lib/Vyatta/ConfigOutput.pm | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/Vyatta/Config.pm b/lib/Vyatta/Config.pm index 4ae578c..4c149cf 100755 --- a/lib/Vyatta/Config.pm +++ b/lib/Vyatta/Config.pm @@ -1,4 +1,4 @@ -# Author: An-Cheng Huang +# Author: Vyatta # Date: 2007 # Description: vyatta configuration parser diff --git a/lib/Vyatta/ConfigOutput.pm b/lib/Vyatta/ConfigOutput.pm index c92cee4..09713f9 100755 --- a/lib/Vyatta/ConfigOutput.pm +++ b/lib/Vyatta/ConfigOutput.pm @@ -1,4 +1,4 @@ -# Author: An-Cheng Huang +# Author: Vyatta # Date: 2007 # Description: Perl module for generating output of the configuration. @@ -143,7 +143,8 @@ sub displayValues { my @cnames = sort keys %cnodes; if (defined($simple_show)) { - if (!$cnodes{'def'} || $show_all) { + if (!defined($cnodes{'def'}) or $cnodes{'def'} eq 'deleted' + or $show_all) { if ($is_password && $hide_password) { $oval = $HIDE_PASSWORD; } @@ -164,15 +165,14 @@ sub displayValues { $diff = '>'; } } - if (!$cnodes{'def'} || $show_all) { + # also need to handle the case where def marker is deleted. + if (!defined($cnodes{'def'}) or $cnodes{'def'} eq 'deleted' + or $show_all) { if ($is_password && $hide_password) { $value = $HIDE_PASSWORD; } print "$dis$diff$prefix$name $value\n"; } - elsif ($cnodes{'def'} && ($diff eq '>' || $diff eq '-')) { - print "$dis$diff$prefix$name $value\n"; - } } } -- cgit v1.2.3