VPP Python API invocation mechanism has changed in 18.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
networking-vpp |
Fix Released
|
Undecided
|
Onong Tayeng |
Bug Description
This is what happens to ML2 agent with the latest VPP master build, ie, 18.04:
[-] Exception in vpp watcher thread
Traceback (most recent call last):
File "/usr/lib/
for name, data in self.get_
File "/usr/lib/
t = self.call_
File "/usr/lib/
func_call = getattr(self._vpp, func)
AttributeError: VPP instance has no attribute 'sw_interface_
And its not just for the API in the stack trace above; it is the same for every API that ML2 agent tries to invoke. But the APIs invoked through VAT work fine.
Following commit is the cause:
otayeng@
commit 49bec57f2534a9d
Author: Klement Sekera <email address hidden>
Date: Sat Feb 17 11:10:30 2018 +0100
vpp_papi: remove legacy way of calling VPP APIs
This allows VPP to define APIs which conflict with internal
function names used in vpp_papi without issues.
Change-Id: I56c21814e1c11f
Signed-off-by: Klement Sekera <email address hidden>
diff --git a/src/vpp-
index 25a83695..c2d12b5b 100644
--- a/src/vpp-
+++ b/src/vpp-
@@ -611,13 +611,6 @@ class VPP():
f = self.make_
-
- # old API stuff starts here - will be removed in 17.07
- if hasattr(self, name):
- raise NameError(
- 3, "Conflicting name in JSON definition: `%s'" % name)
- setattr(self, name, f)
- # old API stuff ends here
else:
otayeng@
VPP Python API invocation mechanism has changed. VPP version 18.04 onwards, the VPP APIs are attributes of the "api" object within the VPPInterface object whereas before 18.04, VPP APIs
are attributes of the VPPInterface object itself.
The new way of invoking the API would be:
1. # show vpp version
2. rv = vpp.api.
3. print('VPP version =', rv.version.
Changed in networking-vpp: | |
assignee: | nobody → Onong Tayeng (onong) |
Fix proposed to branch: master /review. openstack. org/553366
Review: https:/