summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/config.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/python/vyos/utils/config.py b/python/vyos/utils/config.py
index 5bba69a61..1032e22dc 100644
--- a/python/vyos/utils/config.py
+++ b/python/vyos/utils/config.py
@@ -71,6 +71,8 @@ def write_saved_value(path: list, value=None, config_path: str=config_file):
set_tags(ct, path)
ct.set(path, value=value, replace=True)
+ set_leaf(ct, path)
+
write_file(config_path, ct.to_string())
def flag(l: list) -> list:
@@ -92,6 +94,11 @@ def set_tags(ct: 'ConfigTree', path: list) -> None:
if condition:
ct.set_tag(target)
+def set_leaf(ct: 'ConfigTree', path: list) -> None:
+ from vyos.xml_ref import is_leaf
+ if is_leaf(path):
+ ct.set_leaf(path, True)
+
def parse_commands(cmds: str) -> dict:
from re import split as re_split
from shlex import split as shlex_split