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
Send openstack inventory logs to stderr #51827
Conversation
23ec3f0
to
6d789b9
Compare
I put in a changelog fragement, because I would very much like to backport this. |
Build succeeded (third-party-check pipeline).
|
Build succeeded (third-party-check pipeline).
|
# TODO(mordred) Integrate openstack's logging with ansible's logging | ||
sdk.enable_logging() | ||
sdk.enable_logging(stream=sys.stderr) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's fine if a plugin wants to log to a file, but the only supported data source the plugins have are the data from the inventory file, so it could add a log_file
parameter and log there.
Integrating logging with Ansible logging in general would be more complex, and you can read more ranting about this in #51835
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
shipit |
Thanks everybody, merged into |
SUMMARY
Resolves #50100
This redirects logs from the openstack sdk to stderr. This is a blocker for integrating openstack inventories into our systems.
ISSUE TYPE
COMPONENT NAME
lib/ansible/plugins/inventory/openstack.py
ADDITIONAL INFORMATION
This was a TODO item for... @Mordred ??
You can improve on this latter, but I need to get error messages out of stdout. You can put them anywhere else you like later. As long as it's not stdout.
See method docs:
https://github.com/openstack/openstacksdk/blob/9675c1fb0b065017a0fadf75f52d8193cce7dd24/openstack/_log.py#L68-L71
Ping @ryanpetrello in relation to ansible/awx#3107