Message ID | 20240327123130.1322921-2-liuhangbin@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | b334f5ed3d914d46652db2b8aad7d135ad4a50ad |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | doc/netlink/specs: Add vlan support | expand |
diff --git a/tools/net/ynl/lib/ynl.py b/tools/net/ynl/lib/ynl.py index 5fa7957f6e0f..e73b027c5624 100644 --- a/tools/net/ynl/lib/ynl.py +++ b/tools/net/ynl/lib/ynl.py @@ -819,7 +819,10 @@ class YnlFamily(SpecFamily): if display_hint == 'mac': formatted = ':'.join('%02x' % b for b in raw) elif display_hint == 'hex': - formatted = bytes.hex(raw, ' ') + if isinstance(raw, int): + formatted = hex(raw) + else: + formatted = bytes.hex(raw, ' ') elif display_hint in [ 'ipv4', 'ipv6' ]: formatted = format(ipaddress.ip_address(raw)) elif display_hint == 'uuid':