mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user