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.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/vpp-api/python/vpp_papi/vpp_papi.py b/vpp-api/python/vpp_papi/vpp_papi.py
index 6a7a358f6cd..144151c4154 100644
--- a/vpp-api/python/vpp_papi/vpp_papi.py
+++ b/vpp-api/python/vpp_papi/vpp_papi.py
@@ -99,6 +99,12 @@ def disconnect():
logging.info("Disconnected")
return rv
+# CLI convenience wrapper
+def cli_exec(cmd):
+ cmd += '\n'
+ r = cli_inband(len(cmd), cmd)
+ return r.reply[0].decode().rstrip('\x00')
+
def register_event_callback(callback):
event_callback_set(callback)