summaryrefslogtreecommitdiff
path: root/kvmd
diff options
context:
space:
mode:
Diffstat (limited to 'kvmd')
-rw-r--r--kvmd/apps/kvmd/atx.py4
-rw-r--r--kvmd/apps/kvmd/msd.py4
-rw-r--r--kvmd/apps/kvmd/server.py22
3 files changed, 15 insertions, 15 deletions
diff --git a/kvmd/apps/kvmd/atx.py b/kvmd/apps/kvmd/atx.py
index 07522fe8..3bf2bd62 100644
--- a/kvmd/apps/kvmd/atx.py
+++ b/kvmd/apps/kvmd/atx.py
@@ -53,11 +53,11 @@ class AtxIsBusyError(AtxOperationError, aioregion.RegionIsBusyError):
def _atx_working(method: Callable) -> Callable:
- async def wrap(self: "Atx", *args: Any, **kwargs: Any) -> Any:
+ async def wrapper(self: "Atx", *args: Any, **kwargs: Any) -> Any:
if not self._enabled: # pylint: disable=protected-access
raise AtxDisabledError()
return (await method(self, *args, **kwargs))
- return wrap
+ return wrapper
class Atx: # pylint: disable=too-many-instance-attributes
diff --git a/kvmd/apps/kvmd/msd.py b/kvmd/apps/kvmd/msd.py
index b9cb457a..7bf9dff1 100644
--- a/kvmd/apps/kvmd/msd.py
+++ b/kvmd/apps/kvmd/msd.py
@@ -190,13 +190,13 @@ def _explore_device(device_path: str) -> Optional[_MassStorageDeviceInfo]:
def _msd_working(method: Callable) -> Callable:
- async def wrap(self: "MassStorageDevice", *args: Any, **kwargs: Any) -> Any:
+ async def wrapper(self: "MassStorageDevice", *args: Any, **kwargs: Any) -> Any:
if not self._enabled: # pylint: disable=protected-access
raise MsdDisabledError()
if not self._device_path: # pylint: disable=protected-access
raise MsdOfflineError()
return (await method(self, *args, **kwargs))
- return wrap
+ return wrapper
# =====
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py
index 1bd63446..25111e11 100644
--- a/kvmd/apps/kvmd/server.py
+++ b/kvmd/apps/kvmd/server.py
@@ -156,14 +156,14 @@ _COOKIE_AUTH_TOKEN = "auth_token"
def _atomic(handler: Callable) -> Callable:
- async def wrap(self: "Server", request: aiohttp.web.Request) -> aiohttp.web.Response:
+ async def wrapper(self: "Server", request: aiohttp.web.Request) -> aiohttp.web.Response:
return (await asyncio.shield(handler(self, request)))
- return wrap
+ return wrapper
def _exposed(http_method: str, path: str, atomic: bool=False, auth_required: bool=True) -> Callable:
def make_wrapper(handler: Callable) -> Callable:
- async def wrap(self: "Server", request: aiohttp.web.Request) -> aiohttp.web.Response:
+ async def wrapper(self: "Server", request: aiohttp.web.Request) -> aiohttp.web.Response:
try:
if auth_required:
user = request.headers.get(_HEADER_AUTH_USER, "")
@@ -198,17 +198,17 @@ def _exposed(http_method: str, path: str, atomic: bool=False, auth_required: boo
return _json_exception(err, 403)
if atomic:
- wrap = _atomic(wrap)
+ wrapper = _atomic(wrapper)
- setattr(wrap, _ATTR_EXPOSED, True)
- setattr(wrap, _ATTR_EXPOSED_METHOD, http_method)
- setattr(wrap, _ATTR_EXPOSED_PATH, path)
- return wrap
+ setattr(wrapper, _ATTR_EXPOSED, True)
+ setattr(wrapper, _ATTR_EXPOSED_METHOD, http_method)
+ setattr(wrapper, _ATTR_EXPOSED_PATH, path)
+ return wrapper
return make_wrapper
def _system_task(method: Callable) -> Callable:
- async def wrap(self: "Server") -> None:
+ async def wrapper(self: "Server") -> None:
try:
await method(self)
raise RuntimeError("Dead system task: %s" % (method))
@@ -218,8 +218,8 @@ def _system_task(method: Callable) -> Callable:
get_logger().exception("Unhandled exception, killing myself ...")
os.kill(os.getpid(), signal.SIGTERM)
- setattr(wrap, _ATTR_SYSTEM_TASK, True)
- return wrap
+ setattr(wrapper, _ATTR_SYSTEM_TASK, True)
+ return wrapper
class _Events(Enum):