Check output for curl commands
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user