Skip to content

Add option to ignore stderr when executing commands #115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

rabbull
Copy link
Contributor

@rabbull rabbull commented Feb 4, 2025

This PR introduces a new option, ignore_stderr, to the execute function as well as its wrapper method DockerComposeExecutor.execute. The purpose of this addition is to address the issue mentioned in #114, where merging stderr with stdout made it difficult to distinguish between the two outputs. If this flag is set to true, then the stderr outputs are ignored. To keep compatibility with previous versions, the output format of the functions remained unchanged, and this flag is set to false in default.

It's a simple modification that fixed my own problem. I believe it being useful for anyone else encountered into the same problem with me, so I created this PR. Any feedback is welcome.

@augi augi requested a review from Luminaar February 4, 2025 21:03
@augi augi force-pushed the feature/ignore_stderr branch from 711a6e8 to 8168b13 Compare February 4, 2025 21:08
@augi
Copy link
Member

augi commented Feb 4, 2025

Looks like mypy has a problem with untyped **kwargs.

@augi augi force-pushed the feature/ignore_stderr branch from 8168b13 to 1a38ee7 Compare February 4, 2025 21:19
@rabbull rabbull force-pushed the feature/ignore_stderr branch from 1a38ee7 to 07f6c57 Compare February 4, 2025 21:42
@rabbull
Copy link
Contributor Author

rabbull commented Feb 4, 2025

Thanks for checking this out. In last update, I annotated **kwargs as an Any dict, as it should simply pass any arguments throught if I understand correctly.

@augi augi merged commit 1069382 into avast:master Feb 6, 2025
30 checks passed
@rabbull rabbull deleted the feature/ignore_stderr branch February 6, 2025 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants