diff options
author | Ole Troan <ot@cisco.com> | 2018-12-17 12:02:26 +0100 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2018-12-18 11:54:24 +0000 |
commit | 8006c6aa425126529b4017768a9201e4f03964ad (patch) | |
tree | 7b7342e6fb4964a5c8ca65c3d13d8dcc980f120d /src/vpp-api/python/vpp_papi/vpp_serializer.py | |
parent | 02782d6ebd13ce02f2d3facebb54fec3c2137c88 (diff) |
PAPI: Add MACAddress object wrapper for vl_api_mac_address_t
Change the definition of vl_api_mac_address_t to an aliased type.
Change-Id: I1434f316d0fad6a099592f39bceeb8faeaf1d134
Signed-off-by: Ole Troan <ot@cisco.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/vpp_serializer.py')
-rw-r--r-- | src/vpp-api/python/vpp_papi/vpp_serializer.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py index 418c0243402..d62e3a4a57a 100644 --- a/src/vpp-api/python/vpp_papi/vpp_serializer.py +++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py @@ -30,9 +30,10 @@ import socket logger = logging.getLogger(__name__) if sys.version[0] == '2': - check = lambda d: type(d) is dict + def check(d): type(d) is dict else: - check = lambda d: type(d) is dict or type(d) is bytes + def check(d): type(d) is dict or type(d) is bytes + def conversion_required(data, field_type): if check(data): @@ -101,7 +102,7 @@ class String(object): return b'', 0 p = BaseTypes('u8', length) x, size = p.unpack(data, offset + length_field_size) - x2 = x.split(b'\0',1)[0] + x2 = x.split(b'\0', 1)[0] return (x2.decode('utf8'), size + length_field_size) |