summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2023-06-27 18:00:02 +0300
committerzsdc <taras@vyos.io>2023-06-27 18:36:11 +0300
commite30c7fe6a42cd76427432b70a5b629c32be22c47 (patch)
treeb7af4c21d570651db6881014bf41c8dea3c02412 /src
parent8f402c2ba47ed3ccbf94f9f037ec6e18d6b975ea (diff)
downloadvyos-1x-e30c7fe6a42cd76427432b70a5b629c32be22c47.tar.gz
vyos-1x-e30c7fe6a42cd76427432b70a5b629c32be22c47.zip
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') ```
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/vpp.py5
1 files changed, 3 insertions, 2 deletions
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)