Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
| inline |
side by side
Add in-message cli_request/cli_reply API
[vpp.git]
/
vpp-api
/
python
/
vpp_papi
/
vpp_papi.py
diff --git
a/vpp-api/python/vpp_papi/vpp_papi.py
b/vpp-api/python/vpp_papi/vpp_papi.py
index
6a7a358
..
144151c
100644
(file)
--- 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)