Fixing exception import for tower modules (#50447)

* fixing the exception import from tower modules

* Adding tests for checking tower modules are failing with correct msg

* fixed failing tests

* fixed failing test in tower_team
This commit is contained in:
jainnikhil30
2019-01-09 20:01:21 +05:30
committed by René Moser
parent d84e21dfc8
commit cd27982959
27 changed files with 168 additions and 19 deletions

View File

@@ -111,7 +111,7 @@
- assert:
that:
- "result is failed"
- "'must be set when SSH key is encrypted' in result.module_stderr"
- "'must be set when SSH key is encrypted' in result.msg"
- name: Create an invalid SSH credential (Organization not found)
tower_credential:
@@ -126,7 +126,7 @@
- assert:
that:
- "result is failed"
- "'The requested object could not be found' in result.module_stderr"
- "'The requested object could not be found' in result.msg"
- name: Delete an SSH credential
tower_credential:
@@ -522,3 +522,17 @@
- assert:
that:
- "result is changed"
- name: Check module fails with correct msg
tower_credential:
name: test-credential
description: Credential Description
kind: ssh
organization: test-non-existing-org
state: present
register: result
ignore_errors: true
- assert:
that:
- "result.msg =='Failed to update credential, organization not found: The requested object could not be found.'"