Add an env keyword argument to _util.get_subprocess_output#5987
Merged
Conversation
4 tasks
L3n41c
force-pushed
the
lenaic/get_subprocess_output_env
branch
from
August 12, 2020 13:34
47afb1c to
25812be
Compare
…/get_subprocess_output_env
L3n41c
force-pushed
the
lenaic/get_subprocess_output_env
branch
from
August 13, 2020 09:12
cc2871c to
ea9963d
Compare
…/get_subprocess_output_env
L3n41c
force-pushed
the
lenaic/get_subprocess_output_env
branch
3 times, most recently
from
August 14, 2020 14:23
26e49f4 to
1d45abf
Compare
L3n41c
force-pushed
the
lenaic/get_subprocess_output_env
branch
from
August 14, 2020 15:01
fc24030 to
13604c9
Compare
L3n41c
force-pushed
the
lenaic/get_subprocess_output_env
branch
from
August 14, 2020 15:41
8307382 to
03bce84
Compare
L3n41c
marked this pull request as ready for review
August 14, 2020 20:19
hush-hush
requested changes
Aug 14, 2020
…/get_subprocess_output_env
truthbk
reviewed
Sep 1, 2020
truthbk
left a comment
Member
There was a problem hiding this comment.
Some small comments from my side, not sure if @hush-hush has anything else to add.
Nice job 👍
| #define _SUBPROCESS_OUTPUT_ERROR_NS_NAME _UTIL_MODULE_NAME _DOT _SUBPROCESS_OUTPUT_ERROR_NAME | ||
|
|
||
| #ifdef DATADOG_AGENT_THREE | ||
| # define PY_ARG_PARSE_TUPLE_KEYWORD_ONLY "$" |
Member
There was a problem hiding this comment.
Can you add a comment here that this was introduce in python 3.3+?
| returned. | ||
| */ | ||
| PyObject *subprocess_output(PyObject *self, PyObject *args) | ||
| PyObject *subprocess_output(PyObject *self, PyObject *args, PyObject *kw) |
Member
There was a problem hiding this comment.
The doxygen documentation above has to be updated to account for kwargs.
| } | ||
|
|
||
| func charArrayToSlice(array **C.char) (res []string) { | ||
| if array == nil { |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add an
envkeyword argument to_util.get_subprocess_output.Motivation
For DataDog/integrations-core#7095, I would need a python check to be able to spawn a command with custom environment variables.
Additional Notes
Anything else we should know when reviewing?
Describe your test plan
We can patch a python check to make it execute
envwith a custom environment variable and have the check log the output.