From fc7329f3d2bb6b18a36b01626d1fab51bde4012e Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Sat, 28 Jun 2025 23:05:00 -0500 Subject: T7499: expose direct request to http-api --- python/vyos/configsession.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'python') diff --git a/python/vyos/configsession.py b/python/vyos/configsession.py index 175b40260..569a82f3c 100644 --- a/python/vyos/configsession.py +++ b/python/vyos/configsession.py @@ -364,8 +364,13 @@ class ConfigSession(object): return out def merge_config(self, file_path, destructive=False): - destr = ['--destructive'] if destructive else [] - out = self.__run_command(MERGE_CONFIG + [file_path] + destr) + if self._vyconf_session is None: + destr = ['--destructive'] if destructive else [] + out = self.__run_command(MERGE_CONFIG + [file_path] + destr) + else: + out, _ = self._vyconf_session.merge_config( + file=file_path, destructive=destructive + ) return out -- cgit v1.2.3