summaryrefslogtreecommitdiff
path: root/python/vyos/configtree.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-08-20 10:29:33 +0200
committerChristian Poessinger <christian@poessinger.com>2019-08-20 10:29:33 +0200
commit4074315da3b651d1c629430cd3bd4e209a80c6bc (patch)
treec0dc46fdc6fe815e4ec13951cfb5eb2726e18731 /python/vyos/configtree.py
parent246d2dbad9df96ac895e88c9103eefa9f4cf04d7 (diff)
downloadvyos-1x-4074315da3b651d1c629430cd3bd4e209a80c6bc.tar.gz
vyos-1x-4074315da3b651d1c629430cd3bd4e209a80c6bc.zip
vyos.configtree: add help for set method
Diffstat (limited to 'python/vyos/configtree.py')
-rw-r--r--python/vyos/configtree.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/python/vyos/configtree.py b/python/vyos/configtree.py
index a812b62ec..8832a5a63 100644
--- a/python/vyos/configtree.py
+++ b/python/vyos/configtree.py
@@ -185,6 +185,14 @@ class ConfigTree(object):
return self.__to_commands(self.__config).decode()
def set(self, path, value=None, replace=True):
+ """Set new entry in VyOS configuration.
+ path: configuration path e.g. 'system dns forwarding listen-address'
+ value: value to be added to node, e.g. '172.18.254.201'
+ replace: True: current occurance will be replaced
+ False: new value will be appended to current occurances - use
+ this for adding values to a multi node
+ """
+
check_path(path)
path_str = " ".join(map(str, path)).encode()