diff options
author | Ole Troan <ot@cisco.com> | 2019-10-17 21:40:36 +0200 |
---|---|---|
committer | Neale Ranns <nranns@cisco.com> | 2019-10-18 07:49:11 +0000 |
commit | 64e978b1bf1f30672dd305e7c35fefc31887adf2 (patch) | |
tree | d617767562f41cd941032b9320d5c7e21775beaf /src/vpp-api/python | |
parent | 2bb7151daf3cf312804cd2242419017bad5af07a (diff) |
ipsec: make tests support python3
Type: fix
Signed-off-by: Ole Troan <ot@cisco.com>
Change-Id: I3255702e7c562c8d04a91a095e245756c6443a9e
Diffstat (limited to 'src/vpp-api/python')
-rw-r--r-- | src/vpp-api/python/vpp_papi/vpp_serializer.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/vpp-api/python/vpp_papi/vpp_serializer.py b/src/vpp-api/python/vpp_papi/vpp_serializer.py index c01b2d3bd8b..5b45cd8a569 100644 --- a/src/vpp-api/python/vpp_papi/vpp_serializer.py +++ b/src/vpp-api/python/vpp_papi/vpp_serializer.py @@ -188,8 +188,12 @@ class FixedList_u8(object): ' expected: {}' .format(self.name, len(data), self.num)) - return self.packer.pack(data) - + try: + return self.packer.pack(data) + except struct.error: + raise VPPSerializerValueError( + 'Packing failed for "{}" {}' + .format(self.name, kwargs)) def unpack(self, data, offset=0, result=None, ntc=False): if len(data[offset:]) < self.num: raise VPPSerializerValueError( |