summaryrefslogtreecommitdiff
path: root/kvmd/apps/otg
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-10-03 07:54:11 +0300
committerDevaev Maxim <[email protected]>2020-10-03 07:54:11 +0300
commit2881795f80540abe5112768c29f674ff0766ddd6 (patch)
treefa38e7f2222571b1a2da3a4a15b810c843512413 /kvmd/apps/otg
parent400021fc815a84610c620a6d516832dd6f714165 (diff)
refactoring
Diffstat (limited to 'kvmd/apps/otg')
-rw-r--r--kvmd/apps/otg/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kvmd/apps/otg/__init__.py b/kvmd/apps/otg/__init__.py
index e9727cf3..ce731823 100644
--- a/kvmd/apps/otg/__init__.py
+++ b/kvmd/apps/otg/__init__.py
@@ -85,12 +85,12 @@ def _write_bytes(path: str, data: bytes) -> None:
def _find_udc(udc: str) -> str:
- udcs = sorted(os.listdir(f"{env.SYSFS_PREFIX}/sys/class/udc"))
+ candidates = sorted(os.listdir(f"{env.SYSFS_PREFIX}/sys/class/udc"))
if not udc:
- if len(udcs) == 0:
+ if len(candidates) == 0:
raise RuntimeError("Can't find any UDC")
- udc = udcs[0]
- elif udc not in udcs:
+ udc = candidates[0]
+ elif udc not in candidates:
raise RuntimeError(f"Can't find selected UDC: {udc}")
get_logger().info("Using UDC %s", udc)
return udc