mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
python wrapper Decode config data output (#11620)
* decode config_data output * decode config_data output
This commit is contained in:
@@ -123,11 +123,11 @@ def get_config_data(install_dir):
|
|||||||
config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir]
|
config_cmd = ['/usr/bin/env', 'php', '%s/config_to_json.php' % install_dir]
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
proc = subprocess.Popen(config_cmd, stdout=subprocess.PIPE, stdin=subprocess.PIPE)
|
||||||
|
return proc.communicate()[0].decode()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("ERROR: Could not execute: %s" % config_cmd)
|
print("ERROR: Could not execute: %s" % config_cmd)
|
||||||
print(e)
|
print(e)
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
return proc.communicate()[0]
|
|
||||||
|
|
||||||
# Database functions #######################################################
|
# Database functions #######################################################
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user