-
Notifications
You must be signed in to change notification settings - Fork 101
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
Incorrect quiet logic on Compose CLI Component #395
Comments
Hello! This is a bit tricky indeed to always have the same behavior for exceptions and the error message, it's true that the behaviour should be improved if possible. One difficulty we also have is TTY. There is no way we can store interactive output in a string and at the same time, display it in the terminal (maybe I'm wrong, this is the best of my knowledge on the matter). I'll take a look at it when I come back from my holidays. In the meantime, if you want to propose something in a pull request, I'd be glad to review it! |
I have been working on migrating salt from the docker-compose python library and to python on whales. (https://github.com/saltstack/salt/pull/63051/files) I have i similarly want all the compose functions to return their output rather than printing it to screen, along with being able to check the exit code / status from the command run. For use in automation tooling (eg salt or ansible) it is 100% needed to be able to access those outputs to be able to make decisions in other parts of automation scripting. My PR above will be the first PR to move docker compose commands over to the python on whales library. I imagine the same will be used in future for general docker commands from python |
Thank you for the feedback! As always I'm totally open for a pull request in this direction. I'll work on it when I have the time if there is no activity on the subject for a while :) |
Hey,
I have noticed some weird behavior in the Compose component:
run
function ascapture_stdout
(default true), however, the run function is configured to capture output whencapture_stdout
is true and so:capture_stdout
gets set as false)capture_stdout
gets set as true)run
function's output which leads to output not being returned in cases of successful operation (in case of failure, the exception can be caught, which will have the logs (ifquiet
was set to true)python-on-whales/python_on_whales/components/compose/cli_wrapper.py
Line 723 in bc9a3cb
This seems like very odd behavior to me, if it is expected behavior, am I missing something?
Thanks :D
The text was updated successfully, but these errors were encountered: