From df231744b98202ec5fbcd236e795df7399747a0e Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Thu, 23 May 2019 07:38:54 -0500 Subject: 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. --- python/vyos/config.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'python/vyos/config.py') 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: -- cgit v1.2.3