diff options
author | Devaev Maxim <[email protected]> | 2020-10-03 07:54:11 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-10-03 07:54:11 +0300 |
commit | 2881795f80540abe5112768c29f674ff0766ddd6 (patch) | |
tree | fa38e7f2222571b1a2da3a4a15b810c843512413 /kvmd | |
parent | 400021fc815a84610c620a6d516832dd6f714165 (diff) |
refactoring
Diffstat (limited to 'kvmd')
-rw-r--r-- | kvmd/apps/otg/__init__.py | 8 |
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 |