Check output for curl commands

This commit is contained in:
Nate Bowman
2026-10-08 18:36:32 -04:00
parent 17ccd0bab7
commit 5e0a74f8ce
2 changed files with 13 additions and 5 deletions

View File

@@ -2,6 +2,7 @@ import logging
import os
from markupsafe import escape
from pathlib import Path
import subprocess
import time
from website.config import config
@@ -45,3 +46,12 @@ def safely_get_people(unsafe_people: str) -> list(str):
return None
return safe_users
def run_and_log_cmd(cmd):
proc = subprocess.run(cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)
if proc.returncode != 0:
logger.error(proc.stdout)