summaryrefslogtreecommitdiff
path: root/python/vyos/configsession.py
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2019-08-14 13:25:10 -0400
committerDaniil Baturin <daniil@baturin.org>2019-08-14 13:25:10 -0400
commit589952faadcf7700702b24390c1d654706f3a857 (patch)
treeb3d486d0b0bc9e08d706d16d852bcae60b504dc0 /python/vyos/configsession.py
parent4e781d4dec184308ac844a4c2ff7dcfc7832cc77 (diff)
parent8d1e768a6f3285ed717f588f356db9340871b043 (diff)
downloadvyos-1x-589952faadcf7700702b24390c1d654706f3a857.tar.gz
vyos-1x-589952faadcf7700702b24390c1d654706f3a857.zip
Merge branch 'current' into equuleus
Diffstat (limited to 'python/vyos/configsession.py')
-rw-r--r--python/vyos/configsession.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py
index 78f332d66..8626839f2 100644
--- a/python/vyos/configsession.py
+++ b/python/vyos/configsession.py
@@ -23,6 +23,7 @@ DELETE = '/opt/vyatta/sbin/my_delete'
COMMENT = '/opt/vyatta/sbin/my_comment'
COMMIT = '/opt/vyatta/sbin/my_commit'
DISCARD = '/opt/vyatta/sbin/my_discard'
+SHOW_CONFIG = ['/bin/cli-shell-api', 'showConfig']
# Default "commit via" string
APP = "vyos-http-api"
@@ -116,6 +117,7 @@ class ConfigSession(object):
output = p.stdout.read().decode()
if result != 0:
raise ConfigSessionError(output)
+ return output
def get_session_env(self):
return self.__session_env
@@ -146,3 +148,10 @@ class ConfigSession(object):
def discard(self):
self.__run_command([DISCARD])
+
+ def show_config(self, path, format='raw'):
+ config_data = self.__run_command(SHOW_CONFIG + path)
+
+ if format == 'raw':
+ return config_data
+