diff options
author | Ole Troan <ot@cisco.com> | 2016-10-05 11:10:50 +0200 |
---|---|---|
committer | Damjan Marion <dmarion.lists@gmail.com> | 2016-10-05 11:39:14 +0000 |
commit | b8602b595fc89fe8b8fb00cef4820eedf225a93e (patch) | |
tree | 275111a5e3a1011b91939f5347a5aef0dae016b3 /vpp-api/python/vpp_papi/vpp_papi.py | |
parent | d4bc9af55fc9a7bb5133da8c863569497cb92cd0 (diff) |
Python API: Add support for shared memory prefix
Recheck.
This is to support multiple VPP instances on same host.
Change-Id: Ibe511b1f790fc8771900085577423f7e71dc45df
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'vpp-api/python/vpp_papi/vpp_papi.py')
-rw-r--r-- | vpp-api/python/vpp_papi/vpp_papi.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/vpp-api/python/vpp_papi/vpp_papi.py b/vpp-api/python/vpp_papi/vpp_papi.py index 42ddcdc341e..9c2d2b2ba2a 100644 --- a/vpp-api/python/vpp_papi/vpp_papi.py +++ b/vpp-api/python/vpp_papi/vpp_papi.py @@ -86,12 +86,16 @@ def handler(signum, frame): print('Signal handler called with signal', signum) raise IOError("Couldn't connect to VPP!") -def connect(name): +def connect(name, chroot_prefix = None): # Set the signal handler signal.signal(signal.SIGALRM, handler) signal.alarm(3) # 3 second - rv = vpp_api.connect(name, msg_handler) + if not chroot_prefix: + rv = vpp_api.connect(name, msg_handler) + else: + rv = vpp_api.connect(name, msg_handler, chroot_prefix) + signal.alarm(0) # |