-
Notifications
You must be signed in to change notification settings - Fork 664
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
Capture sanity check warnings and display them #3214
Conversation
result = util.run_command(self._ansible_command, debug=self._config.debug) | ||
with warnings.catch_warnings(record=True) as warns: | ||
warnings.filterwarnings("default", category=MoleculeRuntimeWarning) | ||
self._config.driver.sanity_checks() |
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 we should only catch warnings coming from this invocation.
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.
That is what is happening with record, when the context is destroyed the filter is also reset. At least that is what docs are saying.
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 meant that we shouldn't suppress those warnings in run_command()
Captures runtime warnings raise by driver.sanity_check() and display them at the end in case of failure. Related: ansible-community/molecule-podman#76
Captures runtime warnings raise by driver.sanity_check() and
display them at the end in case of failure.
Related: ansible-community/molecule-podman#76