refactoring

This commit is contained in:
Maxim Devaev
2023-03-07 23:54:05 +02:00
parent 002031baf1
commit f652eca9c2
15 changed files with 49 additions and 49 deletions

View File

@@ -174,8 +174,8 @@ class _Service: # pylint: disable=too-many-instance-attributes
real_driver = "rndis"
path = usb.get_gadget_path(self.__gadget, usb.G_FUNCTIONS, f"{real_driver}.usb0/ifname")
logger.info("Using OTG gadget %r ...", self.__gadget)
with open(path) as iface_file:
iface = iface_file.read().strip()
with open(path) as file:
iface = file.read().strip()
logger.info("Using OTG Ethernet interface %r ...", iface)
assert iface
return iface