From 76424174edfb330eecdf2d84ec02f8e9fc0e814f Mon Sep 17 00:00:00 2001 From: botato <63275405+botatooo@users.noreply.github.com> Date: Mon, 11 Jul 2022 02:56:36 -0400 Subject: Use call instead of Popen (#113) --- backend/main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'backend') diff --git a/backend/main.py b/backend/main.py index afd3cc21..99e6c618 100644 --- a/backend/main.py +++ b/backend/main.py @@ -17,7 +17,7 @@ basicConfig(level=CONFIG["log_level"], format="[%(module)s][%(levelname)s]: %(me from asyncio import get_event_loop, sleep from json import dumps, loads from os import path -from subprocess import Popen +from subprocess import call import aiohttp_cors from aiohttp.web import Application, run_app, static @@ -31,8 +31,10 @@ from utilities import Utilities logger = getLogger("Main") async def chown_plugin_dir(_): - Popen(["chown", "-R", "deck:deck", CONFIG["plugin_path"]]) - Popen(["chmod", "-R", "555", CONFIG["plugin_path"]]) + code_chown = call(["chown", "-R", "deck:deck", CONFIG["plugin_path"]]) + code_chmod = call(["chmod", "-R", "555", CONFIG["plugin_path"]]) + if code_chown != 0 or code_chmod != 0: + logger.error(f"chown/chmod exited with a non-zero exit code (chown: {code_chown}, chmod: {code_chmod})") class PluginManager: def __init__(self) -> None: -- cgit v1.2.3