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
VMware: Fix module usages in module_utils #49421
Conversation
Hi @Akasurde, thank you for submitting this pull-request! |
Added unit tests for vmware.py Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
0baaad5
to
3c5b210
Compare
@mattclay Not sure what is happening here. But on my setup, test is passing -
|
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.
shipit
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
552466a
to
4a77334
Compare
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
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.
Do you want to have the unit tests in this PR? It looks like a good start and i don't mind. But the changelog doesn't reflect it :)
@pdellaert I added TCs for this change only. Would love to see them backported to 2.7 and 2.6. |
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@mattclay Could please review this ? Thanks. |
raise ExitJson(*args, **kwargs) | ||
|
||
def fail_json(self, *args, **kwargs): | ||
raise FailJson(*args, **kwargs) |
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.
Note: This is not a blocker:
I haven't tested but you probably don't have to do this. You can catch SystemExit instead.
This does give you the additional data that exit_json vs fail_json was called, though. (although since you're checking the exit message, that might be redundant.
@resmo @abadger @mattclay @pdellaert Thanks for the review. |
* VMware: Fix module usages in module_utils * Skip test for Python 2.6 as SSL context is not available in Python 2.6 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 1b04571)
* VMware: Fix module usages in module_utils * Skip test for Python 2.6 as SSL context is not available in Python 2.6 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 1b04571)
* VMware: Fix module usages in module_utils * Skip test for Python 2.6 as SSL context is not available in Python 2.6 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 1b04571)
* VMware: Fix module usages in module_utils * Skip test for Python 2.6 as SSL context is not available in Python 2.6 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com> (cherry picked from commit 1b04571)
* VMware: Fix module usages in module_utils * Skip test for Python 2.6 as SSL context is not available in Python 2.6 Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
SUMMARY
Added unit tests for vmware.py
Signed-off-by: Abhijeet Kasurde akasurde@redhat.com
ISSUE TYPE
COMPONENT NAME
changelogs/fragments/47313-vmware-fix_module_error.yaml
lib/ansible/module_utils/vmware.py
test/units/module_utils/test_vmware.py