diff options
Diffstat (limited to 'kvmd/plugins/msd/otg')
-rw-r--r-- | kvmd/plugins/msd/otg/helpers.py | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/kvmd/plugins/msd/otg/helpers.py b/kvmd/plugins/msd/otg/helpers.py index ee759ef0..df004c6d 100644 --- a/kvmd/plugins/msd/otg/helpers.py +++ b/kvmd/plugins/msd/otg/helpers.py @@ -20,14 +20,12 @@ # ========================================================================== # -import signal -import asyncio -import asyncio.subprocess - from typing import List from ....logging import get_logger +from .... import aioproc + from .. import MsdError @@ -62,14 +60,8 @@ async def _run_helper(cmd: List[str]) -> None: logger = get_logger(0) logger.info("Executing helper %s ...", cmd) - proc = await asyncio.create_subprocess_exec( - *cmd, - stdout=asyncio.subprocess.PIPE, - stderr=asyncio.subprocess.STDOUT, - preexec_fn=(lambda: signal.signal(signal.SIGINT, signal.SIG_IGN)), - ) + (proc, stdout) = await aioproc.read_process(cmd) - stdout = (await proc.communicate())[0].decode(errors="ignore").strip() if stdout: log = (logger.info if proc.returncode == 0 else logger.error) for line in stdout.split("\n"): |