Closed
Labels
Featurenew functionality including changes to functionality and code refactors, etc.RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.Salt-Cloudstale
Milestone
Description
When provisioning VMs salt-cloud --out json interleaves JSON and the bootstrap output all to stdout which makes it impossible to consume via scripts -- you can't know where the logging/bootstrap output stops and where JSON begins.
Metadata
Metadata
Assignees
Labels
Featurenew functionality including changes to functionality and code refactors, etc.RIoTRelates to integration with cloud providers, hypervisors, API-based services, etc.Salt-Cloudstale
Activity
techhat commentedon Aug 4, 2014
@s0undt3ch should SSH output be changed to STDERR? Maybe change it to use the logger?
techhat commentedon Aug 4, 2014
@whiteinge in the meantime, check out http://docs.saltstack.com/en/latest/topics/cloud/misc.html#hide-output-from-minion-install
whiteinge commentedon Aug 4, 2014
Good to know. Thanks.
s0undt3ch commentedon Aug 4, 2014
I'd be against packing all ssh output into
stderr. I believe whatever comes onstdoutshould be onstdoutand the same forstderr.So, I believe this is not a bug.
However, I would not be against exposing
display_ssh_outputto the parsers code by adding support for--hide-ssh-output.Would this do it?
whiteinge commentedon Aug 4, 2014
If so would we set that option automatically for --out=json?
We could capture stdout/stderr and add it to the return data structure as
stout/stderr fields. Or have that as an opt-in flag.
I'm ok with either solution but if --out=json returns non-json it's a bug.
s0undt3ch commentedon Aug 5, 2014
hmm, we could auto hide it if
--outis not set to it's default and still show it by adding and using--show-ssh-output?whiteinge commentedon Aug 5, 2014
After sleeping on it, I'd like to keep the
display_ssh_outputoption as-is (maybe add a CLI flag for it). Then based on that setting collect stdout/stderr into a var and include it in the actual returned data structure. That way the output format doesn't matter. I don't know what's involved in making that change but I'll try to find some time to dive into it myself.bogdanr commentedon Nov 23, 2015
I am also experiencing this problem on 2015.8.1-121-gc1ac330
Indeed the output is not usable as json in any circumstance.
In my opinion the error log should also be parsed as json when that option is used and the --static parameter should be implemented for salt-cloud and it should be implicit.
stale commentedon Feb 10, 2018
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.