diff options
author | Maxim Devaev <[email protected]> | 2022-04-12 12:45:27 +0300 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2022-04-12 12:45:27 +0300 |
commit | 04e0ad213aa73745f988005abb3dcebee2c10ae7 (patch) | |
tree | b1f31ac887bb42b83df68ffe1b4644260d16c6c6 | |
parent | 047d8ad760249858034d13a523b99af1bc9b6c1d (diff) |
removed unnecessary proc.returncode
-rw-r--r-- | kvmd/aioproc.py | 4 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/cmd.py | 2 | ||||
-rw-r--r-- | kvmd/plugins/ugpio/ipmi.py | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/kvmd/aioproc.py b/kvmd/aioproc.py index 013f2f8c..4cc3fbf5 100644 --- a/kvmd/aioproc.py +++ b/kvmd/aioproc.py @@ -105,14 +105,14 @@ async def kill_process(proc: asyncio.subprocess.Process, wait: float, logger: lo if proc.returncode is not None: raise await proc.wait() - logger.info("Process killed: pid=%d; retcode=%d", proc.pid, proc.returncode) + logger.info("Process killed: retcode=%d", proc.pid, proc.returncode) except asyncio.CancelledError: pass except Exception: if proc.returncode is None: logger.exception("Can't kill process pid=%d", proc.pid) else: - logger.info("Process killed: pid=%d; retcode=%d", proc.pid, proc.returncode) + logger.info("Process killed: retcode=%d", proc.pid, proc.returncode) def rename_process(suffix: str, prefix: str="kvmd") -> None: diff --git a/kvmd/plugins/ugpio/cmd.py b/kvmd/plugins/ugpio/cmd.py index 3dfaa4b3..72f7ee8e 100644 --- a/kvmd/plugins/ugpio/cmd.py +++ b/kvmd/plugins/ugpio/cmd.py @@ -81,7 +81,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute try: proc = await aioproc.log_process(self.__cmd, logger=get_logger(0), prefix=str(self)) if proc.returncode != 0: - raise RuntimeError(f"Custom command error: pid={proc.pid}; retcode={proc.returncode}") + raise RuntimeError(f"Custom command error: retcode={proc.returncode}") except Exception as err: get_logger(0).error("Can't run custom command %s: %s", self.__cmd, tools.efmt(err)) raise GpioDriverOfflineError(self) diff --git a/kvmd/plugins/ugpio/ipmi.py b/kvmd/plugins/ugpio/ipmi.py index e3708022..65c7efdf 100644 --- a/kvmd/plugins/ugpio/ipmi.py +++ b/kvmd/plugins/ugpio/ipmi.py @@ -155,7 +155,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute try: proc = await aioproc.log_process(**self.__make_ipmitool_kwargs(action), logger=get_logger(0), prefix=str(self)) if proc.returncode != 0: - raise RuntimeError(f"Ipmitool error: pid={proc.pid}; retcode={proc.returncode}") + raise RuntimeError(f"Ipmitool error: retcode={proc.returncode}") except Exception as err: get_logger(0).error("Can't send IPMI power-%s request to %s:%d: %s", action, self.__host, self.__port, tools.efmt(err)) @@ -167,7 +167,7 @@ class Plugin(BaseUserGpioDriver): # pylint: disable=too-many-instance-attribute try: (proc, text) = await aioproc.read_process(**self.__make_ipmitool_kwargs("status")) if proc.returncode != 0: - raise RuntimeError(f"Ipmitool error: pid={proc.pid}; retcode={proc.returncode}") + raise RuntimeError(f"Ipmitool error: retcode={proc.returncode}") stripped = text.strip() if stripped.startswith("Chassis Power is "): self.__power = (stripped != "Chassis Power is off") |