-
Notifications
You must be signed in to change notification settings - Fork 73
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
When using json()
failing command has output on stdout and not stderr
#90
Comments
@maschmann do you accept a PR for one of these cases? |
Hi, |
@bambamboole I thought of something more like this: https://github.com/maschmann/php-ansible/tree/fix/use-stdout-for-error-in-json-mode |
@maschmann thats absolutely fine. This would also solve my issue (which leads to no need of my fork anymore) 🚀 |
Would be great if you could also tests this in your environment. Worked fine for me, but the more testing, the better :-) |
ok, but then I need a few days. |
Just let me know if got around to testing it - I'll be around a bit more frequent than the past months. |
Could be a |
Exactly - I'd include the host sprintf change you made and prepare the rc 👍 |
Hi @bambamboole, I've added most changes to the rc. You'd still have to contribute the sprintf change for hosts. Otherwise I'm pretty sure, we're mostly through. |
will check in the evening ! thx for reminding me. |
Thanks, totally missed that 🙄 . So, great, works again! |
When the option
json()
is turned on, a not successful execution has its output in onstdout
and not onstderr
.I am not sure whats the best way to get around the issue, that a failing execution does not output anything
Option 1:
Check in
runProcess
if theANSIBLE_STDOUT_CALLBACK
is set tojson
and then return$process->getOutput()
instead of$process->getErrorOutput()
.Option 2:
Make the process accesible from the outside and make the user responsible to get the right output
Option 3:
just always return
$process->getOutput()
(don't know how it's withoutjson
enabled)The text was updated successfully, but these errors were encountered: