diff options
author | Max <msuraev@sysmocom.de> | 2017-12-21 14:38:39 +0100 |
---|---|---|
committer | Max <msuraev@sysmocom.de> | 2017-12-28 19:34:48 +0100 |
commit | 566f2a7590fbee3337c016b561af8b0c42e2364f (patch) | |
tree | 9a6a8510226b8a18137f37784df9814d9bc106e2 /scripts/osmo_ctrl.py | |
parent | 8a02e36575d92360bc482e8453b1df04182f3390 (diff) |
Update ctrl command parsing for python3
* make parse() return command id in addition to variable name and value
* introduce parse_kv() wrapper which ignores that id and use it instead
of old parse()
* make parse() compatible with python3 where we got bytes, not string
from the socket so we have to decode it properly before using split()
* expand test_py3.py with simply asyn server which verifies that
osmo_ctrl.py works properly
Change-Id: I599f9f5a18109929f59386ab4416b8bfd75c74d1
Diffstat (limited to 'scripts/osmo_ctrl.py')
-rwxr-xr-x | scripts/osmo_ctrl.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/osmo_ctrl.py b/scripts/osmo_ctrl.py index 8c0608f..ac20050 100755 --- a/scripts/osmo_ctrl.py +++ b/scripts/osmo_ctrl.py @@ -40,8 +40,8 @@ def connect(host, port): def do_set_get(sck, var, value = None): (r, c) = Ctrl().cmd(var, value) sck.send(c) - answer = Ctrl().rem_header(sck.recv(4096)) - return (answer,) + Ctrl().verify(answer, r, var, value) + ret = sck.recv(4096) + return (Ctrl().rem_header(ret),) + Ctrl().verify(ret, r, var, value) def set_var(sck, var, val): (a, _, _) = do_set_get(sck, var, val) |