Skip to content
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

Merged
merged 1 commit into from Feb 13, 2019

Conversation

AlanCoding
Copy link
Member

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
  • Bugfix Pull Request
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

@AlanCoding
Copy link
Member Author

I put in a changelog fragement, because I would very much like to backport this.

@ansibot
Copy link
Contributor

ansibot commented Feb 6, 2019

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. inventory Inventory category needs_triage Needs a first human triage before being processed. openstack support:community This issue/PR relates to code supported by the Ansible community. labels Feb 6, 2019
@opendev-zuul
Copy link

opendev-zuul bot commented Feb 6, 2019

Build succeeded (third-party-check pipeline).

@opendev-zuul
Copy link

opendev-zuul bot commented Feb 6, 2019

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Should the inventory plugin be doing its own logging? @emonty Looks like logging was initially added in d548c47

Copy link
Member Author

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

@ansibot ansibot removed the needs_triage Needs a first human triage before being processed. label Feb 6, 2019
Copy link
Contributor

@cloudnull cloudnull left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maxamillion
Copy link
Contributor

shipit

@ansibot ansibot added shipit This PR is ready to be merged by Core and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 12, 2019
@gundalow gundalow merged commit af9ff07 into ansible:devel Feb 13, 2019
@gundalow
Copy link
Contributor

Thanks everybody, merged into devel for release in Ansible 2.8

kdelee pushed a commit to kdelee/ansible that referenced this pull request Feb 15, 2019
@ansible ansible locked and limited conversation to collaborators Jul 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud inventory Inventory category openstack shipit This PR is ready to be merged by Core support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ansible-inventory gives extra error text from openstack plugin, making it non-parsable
6 participants