From e30c7fe6a42cd76427432b70a5b629c32be22c47 Mon Sep 17 00:00:00 2001 From: zsdc Date: Tue, 27 Jun 2023 18:00:02 +0300 Subject: VPP: T1797: Replaced CLI with API Replaced CLI commands with API calls. CLI commands still can be used via: ``` vpp_control = VPPControl() vpp_control.cli_cmd('command_here') ``` --- src/conf_mode/vpp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/conf_mode/vpp.py b/src/conf_mode/vpp.py index aa6c14e89..d541e52ba 100755 --- a/src/conf_mode/vpp.py +++ b/src/conf_mode/vpp.py @@ -28,8 +28,8 @@ from vyos.template import render from vyos.xml import defaults from vyos import ConfigError -from vyos import vpp from vyos import airbag +from vyos.vpp import VPPControl airbag.enable() @@ -124,10 +124,11 @@ def apply(config): call('systemctl daemon-reload') call('sudo sysctl -w vm.nr_hugepages=4096') + vpp_control = VPPControl() for iface, _ in config['interface'].items(): # Create lcp if iface not in Section.interfaces(): - vpp.lcp_create_host_interface(iface) + vpp_control.lcp_pair_add(iface, iface) # update interface config #e = EthernetIf(iface) -- cgit v1.2.3