From Dan Kenigsberg danken@redhat.com:
Dan Kenigsberg has posted comments on this change.
Change subject: network: make ipwrapper.drv_name Python 3 compatible ......................................................................
Patch Set 7: Code-Review-1
(1 comment)
https://gerrit.ovirt.org/#/c/77940/7/lib/vdsm/network/ipwrapper.py File lib/vdsm/network/ipwrapper.py:
Line 255: Line 256: Throws IOError ENODEV for non existing devices. Line 257: Throws IOError EOPNOTSUPP for non supported devices, i.g., loopback. Line 258: """ Line 259: encoded_name = devName.encode('utf-8') it would be extremely cowardly, but the easiest way to make this pass is to add a condition here.
if devName is string: encode() if bytes: keep
The noble thing to do is to make sure that devName has a specific type. I suspect that it has to be bytes, since the kernel would accept non-utf8 string of bytes as interface names. Line 260: ETHTOOL_GDRVINFO = 0x00000003 # ETHTOOL Get driver info command Line 261: SIOCETHTOOL = 0x8946 # Ethtool interface Line 262: DRVINFO_FORMAT = '= I 32s 32s 32s 32s 32s 12s 5I' Line 263: IFREQ_FORMAT = '16sPi' # device_name, buffer_pointer, buffer_len
vdsm-patches@lists.fedorahosted.org