Skip to content

Commit bd657de

Browse files
authored
[subprocess_output] Add compatibility layer with datadog_checks_base (#3723)
1 parent 7318fc0 commit bd657de

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

utils/subprocess_output.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ def get_subprocess_output(command, log, raise_on_empty_output=True):
2020
Run the given subprocess command and return its output. Raise an Exception
2121
if an error occurs.
2222
"""
23+
return subprocess_output(command, raise_on_empty_output)
24+
25+
26+
def subprocess_output(command, raise_on_empty_output):
27+
"""
28+
Run the given subprocess command and return its output. This is a private method
29+
and should not be called directly, use `get_subprocess_output` instead.
30+
"""
2331

2432
# Use tempfile, allowing a larger amount of memory. The subprocess.Popen
2533
# docs warn that the data read is buffered in memory. They suggest not to
@@ -29,9 +37,6 @@ def get_subprocess_output(command, log, raise_on_empty_output=True):
2937
proc.wait()
3038
stderr_f.seek(0)
3139
err = stderr_f.read()
32-
if err:
33-
log.debug("Error while running {0} : {1}".format(" ".join(command), err))
34-
3540
stdout_f.seek(0)
3641
output = stdout_f.read()
3742

0 commit comments

Comments
 (0)