Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

molecule_vagrant/modules/vagrant.py: Improve error handling #80

Merged
merged 1 commit into from
Nov 4, 2020

Conversation

apatard
Copy link
Member

@apatard apatard commented Oct 30, 2020

  • Make sure that up() is exiting with either exit_json() or fail_json()

  • Catch errors for calls to vagrant.conf() and vagrant.status()

  • Now that the functions up/destroy/halt of the VagrantClient class
    should all be exiting with proper fail/exit_json, but in the case of
    the last line of main() is still reached, change the code to use
    VagrantClient result to avoid the following exception:

AttributeError: 'AnsibleModule' object has no attribute 'result'

Signed-off-by: Arnaud Patard apatard@hupstream.com

- Make sure that up() is exiting with either exit_json() or fail_json()
- Catch errors for calls to vagrant.conf() and vagrant.status()

- Now that the functions up/destroy/halt of the VagrantClient class
should all be exiting with proper fail/exit_json, but in the case of
the last line of main() is still reached, change the code to use
VagrantClient result to avoid the following exception:

AttributeError: 'AnsibleModule' object has no attribute 'result'

Signed-off-by: Arnaud Patard <apatard@hupstream.com>
@ssbarnea ssbarnea merged commit 6f9de3a into ansible-community:master Nov 4, 2020
@ssbarnea ssbarnea added the bug Something isn't working label Nov 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants