summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-05-23 16:45:06 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2011-05-23 16:45:06 -0700
commit9fdfdd66cd10415e331017c8f324f29cbb064c09 (patch)
tree2ec112189b0923fcc1c8b2fbc182124cf29cabf4
parente171d0c29e993f46e098901a18d274b627e0b023 (diff)
downloadvyatta-config-mgmt-9fdfdd66cd10415e331017c8f324f29cbb064c09.tar.gz
vyatta-config-mgmt-9fdfdd66cd10415e331017c8f324f29cbb064c09.zip
fix showConfig usage for "compare"
* default behavior for showConfig is to compare @ACTIVE and @WORKING, so no need to write to a file first. * previously @ACTIVE was written to a file first _without_ "default" values, which means any "default" value in @WORKING will be printed by "compare" even if it has not been changed.
-rwxr-xr-xscripts/vyatta-config-mgmt.pl8
1 files changed, 4 insertions, 4 deletions
diff --git a/scripts/vyatta-config-mgmt.pl b/scripts/vyatta-config-mgmt.pl
index 90bda6c..d125e36 100755
--- a/scripts/vyatta-config-mgmt.pl
+++ b/scripts/vyatta-config-mgmt.pl
@@ -273,12 +273,12 @@ if ($action eq 'diff') {
print "No changes between working and active configurations\n";
exit 0;
}
- my $tmp_config_file = "/tmp/config.boot.$$";
- system("cli-shell-api showCfg --show-active-only > $tmp_config_file");
- my $diff = `cli-shell-api showConfig --show-cfg1 $tmp_config_file --show-cfg2 \@WORKING --show-show-defaults --show-context-diff`;
+ my $show_args = '--show-show-defaults --show-context-diff';
+ # default behavior for showConfig is @ACTIVE vs. @WORKING, so no
+ # need to write to a file first
+ my $diff = `cli-shell-api showConfig $show_args`;
if (defined $diff and length($diff) > 0) {
print "$diff";
- system("rm $tmp_config_file");
} else {
print "No changes between working and active configurations\n";
exit 0;