Use call instead of Popen (#113)

This commit is contained in:
botato
2022-07-11 02:56:36 -04:00
committed by GitHub
parent b618fe1e97
commit 76424174ed
+5 -3
View File
@@ -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: