summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJannik Schönartz2020-11-10 18:25:48 +0100
committerJannik Schönartz2020-11-10 18:25:48 +0100
commit2761c8803a7397d1fd4fee51d21e8931b1bb5157 (patch)
treebbb4d3281112789ceaaed98eed16bc2f0a328e94
parentAdd lshw (diff)
downloadsystemd-init-2761c8803a7397d1fd4fee51d21e8931b1bb5157.tar.gz
systemd-init-2761c8803a7397d1fd4fee51d21e8931b1bb5157.tar.xz
systemd-init-2761c8803a7397d1fd4fee51d21e8931b1bb5157.zip
Change capture_output to stdout and stderr to add compatebility to python < python3.7
-rwxr-xr-xmodules.d/bas-python/scripts/00collect_hw_info_json.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/modules.d/bas-python/scripts/00collect_hw_info_json.py b/modules.d/bas-python/scripts/00collect_hw_info_json.py
index 77e62edb..8176bdc5 100755
--- a/modules.d/bas-python/scripts/00collect_hw_info_json.py
+++ b/modules.d/bas-python/scripts/00collect_hw_info_json.py
@@ -1,6 +1,7 @@
from dmiparser import DmiParser
import json
import subprocess
+from subprocess import PIPE
import shlex
import sys
import argparse
@@ -11,7 +12,7 @@ __debug = False
# Run dmi command as subprocess and get the stdout
def run_subprocess(_cmd):
global __debug
- proc = subprocess.run(_cmd, shell=True, capture_output=True)
+ proc = subprocess.run(_cmd, shell=True, stdout=PIPE, stderr=PIPE)
stdout = proc.stdout
stderr = proc.stderr