summaryrefslogtreecommitdiff
path: root/python/vyos/config.py
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@sentrium.io>2019-05-23 07:38:54 -0500
committerJohn Estabrook <jestabro@sentrium.io>2019-05-28 10:00:43 -0500
commitdf231744b98202ec5fbcd236e795df7399747a0e (patch)
tree8fdaf63146872172e7845062fe04e43b397d7649 /python/vyos/config.py
parentbf0f721432fa05bbc7058a0b43e2acf4ad1f30e3 (diff)
downloadvyos-1x-df231744b98202ec5fbcd236e795df7399747a0e.tar.gz
vyos-1x-df231744b98202ec5fbcd236e795df7399747a0e.zip
T1397: Rewrite the config merge script
Add vyos.config.show_config to show working configuration. Add vyos.remote.get_config_remote() for obtaining remote config files.
Diffstat (limited to 'python/vyos/config.py')
-rw-r--r--python/vyos/config.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/python/vyos/config.py b/python/vyos/config.py
index bcf04225b..9a5125eb9 100644
--- a/python/vyos/config.py
+++ b/python/vyos/config.py
@@ -169,6 +169,21 @@ class Config(object):
except VyOSError:
return False
+ def show_config(self, path='', default=None):
+ """
+ Args:
+ path (str): Configuration tree path, or empty
+ default (str): Default value to return
+
+ Returns:
+ str: working configuration
+ """
+ try:
+ out = self._run(self._make_command('showConfig', path))
+ return out
+ except VyOSError:
+ return(default)
+
def is_multi(self, path):
"""
Args: