mirror of
https://github.com/ansible/awx.git
synced 2026-01-11 10:00:01 -03:30
switched exit_json to be fail_json so it didn't trigger an error when attempting to utilize the missing_required_lib from ansible. Additionally fixed it for the second usage for correct usage. Given that it is an exception the correct one would not be to exit without failure, as exit_json does, but instead to use fail_json and be able to present the error
This commit is contained in:
parent
a9cfae70ff
commit
5df37d4279
@ -24,7 +24,7 @@ class TowerAWXKitModule(TowerModule):
|
||||
|
||||
# Die if we don't have AWX_KIT installed
|
||||
if not HAS_AWX_KIT:
|
||||
self.exit_json(msg=missing_required_lib('awxkit'))
|
||||
self.fail_json(msg=missing_required_lib('awxkit'))
|
||||
|
||||
# Establish our conneciton object
|
||||
self.connection = Connection(self.host, verify=self.verify_ssl)
|
||||
@ -38,7 +38,7 @@ class TowerAWXKitModule(TowerModule):
|
||||
self.connection.login(username=self.username, password=self.password)
|
||||
self.authenticated = True
|
||||
except Exception:
|
||||
self.exit_json("Failed to authenticate")
|
||||
self.fail_json("Failed to authenticate")
|
||||
|
||||
def get_api_v2_object(self):
|
||||
if not self.apiV2Ref:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user