Fix python config fetch disrupted by stderr output (#13295)

* Fix python config fetch disrupted by stderr output

I have no idea how to make command_runner not include debug output, so just use subprocess.check_output

* restore import
This commit is contained in:
Tony Murray
2021-10-01 07:58:17 -05:00
committed by GitHub
parent 124e742518
commit c84b462ac0

View File

@@ -9,6 +9,7 @@ from collections import deque
from logging.handlers import RotatingFileHandler
from math import ceil
from queue import Queue
from subprocess import check_output
from time import time
from .command_runner import command_runner
@@ -169,10 +170,7 @@ def get_config_data(base_dir):
config_cmd = ["/usr/bin/env", "php", "%s/config_to_json.php" % base_dir]
try:
exit_code, output = command_runner(config_cmd, timeout=300)
if exit_code == 0:
return json.loads(output)
raise EnvironmentError
return json.loads(check_output(config_cmd).decode())
except Exception as exc:
logger.critical("ERROR: Could not execute command [%s]: %s" % (config_cmd, exc))
logger.debug("Traceback:", exc_info=True)