From 508d380b8ef4079d539a3845705f1bf3aeff3a67 Mon Sep 17 00:00:00 2001 From: Matthias Fetzer Date: Wed, 4 Mar 2020 10:43:23 +0100 Subject: http api: T2096: Added show and generate --- python/vyos/configsession.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'python') diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index d326b3b11..aaf08e726 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -29,6 +29,7 @@ SAVE_CONFIG = ['/opt/vyatta/sbin/vyatta-save-config.pl'] INSTALL_IMAGE = ['/opt/vyatta/sbin/install-image'] REMOVE_IMAGE = ['/opt/vyatta/bin/vyatta-boot-image.pl', '--del'] GENERATE = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'generate'] +SHOW = ['/opt/vyatta/bin/vyatta-op-cmd-wrapper', 'show'] # Default "commit via" string APP = "vyos-http-api" @@ -181,5 +182,10 @@ class ConfigSession(object): return out def generate(self, cmd): - out = self.__run_command(GENERATE + cmd) + out = self.__run_command(GENERATE + cmd.split()) return out + + def show(self, cmd): + out = self.__run_command(SHOW + cmd.split()) + return out + -- cgit v1.2.3