summaryrefslogtreecommitdiff
path: root/src/cnode
diff options
context:
space:
mode:
authorAn-Cheng Huang <ancheng@vyatta.com>2011-04-13 15:32:55 -0700
committerAn-Cheng Huang <ancheng@vyatta.com>2011-04-13 15:32:55 -0700
commitbea24e830d53460703c9bdefd54476080b011450 (patch)
treea940758dd93c205670d54898ed16a09e33a61899 /src/cnode
parent7659d4706b5c167f826d7ab4ecb2ef4a7eb74d7a (diff)
downloadvyatta-cfg-bea24e830d53460703c9bdefd54476080b011450.tar.gz
vyatta-cfg-bea24e830d53460703c9bdefd54476080b011450.zip
fix for bug 6996
* add "ignore-edit" option for config output. * ignore "edit level" when saving config file.
Diffstat (limited to 'src/cnode')
-rw-r--r--src/cnode/cnode-algorithm.cpp4
-rw-r--r--src/cnode/cnode-algorithm.hpp2
2 files changed, 3 insertions, 3 deletions
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<Cpath>& 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<CfgNode> aroot, wroot, croot1, croot2;
tr1::shared_ptr<Cstore> 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