Python API: event_callback not initialised. 84/4884/2
authorOle Troan <ot@cisco.com>
Thu, 26 Jan 2017 10:13:00 +0000 (11:13 +0100)
committerDamjan Marion <dmarion.lists@gmail.com>
Fri, 27 Jan 2017 01:06:47 +0000 (01:06 +0000)
Even when not requesting notification the VPP API
sends event notifications on certain calls. E.g.
creating interfaces.

Traceback (most recent call last):
  File "/vpp/ipfix/src/vpp-api/python/vpp_papi/vpp_papi.py", line 447, in msg_handler_sync
    if self.event_callback:
AttributeError: VPP instance has no attribute 'event_callback'

Change-Id: I4ca30c49df298655dc8948c5ebd68de0b3d6a592
Signed-off-by: Ole Troan <ot@cisco.com>
src/vpp-api/python/vpp_papi/vpp_papi.py

index cefbe37..110f4b1 100644 (file)
@@ -62,6 +62,7 @@ class VPP():
         self.results = {}
         self.timeout = 5
         self.apifiles = []
+        self.event_callback = None
 
         if not apifiles:
             # Pick up API definitions from default directory