aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api/python/vpp_papi/vpp_papi.py
diff options
context:
space:
mode:
Diffstat (limited to 'vpp-api/python/vpp_papi/vpp_papi.py')
-rw-r--r--vpp-api/python/vpp_papi/vpp_papi.py8
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)
#