From bea24e830d53460703c9bdefd54476080b011450 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 13 Apr 2011 15:32:55 -0700 Subject: fix for bug 6996 * add "ignore-edit" option for config output. * ignore "edit level" when saving config file. --- src/cnode/cnode-algorithm.cpp | 4 ++-- src/cnode/cnode-algorithm.hpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cnode') diff --git a/src/cnode/cnode-algorithm.cpp b/src/cnode/cnode-algorithm.cpp index 7574e2e..602d9fb 100644 --- a/src/cnode/cnode-algorithm.cpp +++ b/src/cnode/cnode-algorithm.cpp @@ -894,14 +894,14 @@ cnode::get_cmds(const CfgNode& cfg, vector& set_list, void cnode::showConfig(const string& cfg1, const string& cfg2, const Cpath& path, bool show_def, bool hide_secret, - bool context_diff, bool show_cmds) + bool context_diff, bool show_cmds, bool ignore_edit) { tr1::shared_ptr aroot, wroot, croot1, croot2; tr1::shared_ptr cstore; Cpath rpath(path); Cpath cur_path; - if ((cfg1 == ACTIVE_CFG || cfg1 == WORKING_CFG) + if (!ignore_edit && (cfg1 == ACTIVE_CFG || cfg1 == WORKING_CFG) && (cfg2 == ACTIVE_CFG || cfg2 == WORKING_CFG)) { // active/working config only => use edit level and path cstore.reset(Cstore::createCstore(true)); diff --git a/src/cnode/cnode-algorithm.hpp b/src/cnode/cnode-algorithm.hpp index 2f8995d..3985b9f 100644 --- a/src/cnode/cnode-algorithm.hpp +++ b/src/cnode/cnode-algorithm.hpp @@ -42,7 +42,7 @@ extern const string WORKING_CFG; void showConfig(const string& cfg1, const string& cfg2, const Cpath& path, bool show_def = false, bool hide_secret = false, bool context_diff = false, - bool show_cmds = false); + bool show_cmds = false, bool ignore_edit = false); } // namespace cnode -- cgit v1.2.3