1
0
mirror of https://github.com/CumulusNetworks/ifupdown2.git synced 2024-05-06 15:54:50 +00:00

python3: nlpacket: LINKINFO: info_kind as a string not bytes

The rest of the code expects link kind to be a string(str) and not bytes

Signed-off-by: Julien Fortin <julien@cumulusnetworks.com>
This commit is contained in:
Julien Fortin
2019-12-17 17:02:34 +01:00
parent 2ead3536f2
commit fefbda193d

View File

@ -2969,7 +2969,8 @@ class AttributeIFLA_LINKINFO(Attribute):
return
if sub_attr_type in (Link.IFLA_INFO_KIND, Link.IFLA_INFO_SLAVE_KIND):
self.value[sub_attr_type] = remove_trailing_null(unpack('%ds' % (sub_attr_length - 4), data[4:sub_attr_length])[0])
kind = remove_trailing_null(unpack('%ds' % (sub_attr_length - 4), data[4:sub_attr_length])[0])
self.value[sub_attr_type] = kind.decode() if isinstance(kind, bytes) else kind
elif sub_attr_type == Link.IFLA_INFO_DATA:
self.value[Link.IFLA_INFO_DATA] = self.decode_ifla_info_nested_data(