mirror of
https://github.com/famedly/ansible-collection-matrix
synced 2024-11-10 05:34:16 +00:00
fix: allow to call exit/fail from check-mode
This commit is contained in:
parent
a4361b1623
commit
bf7f2328e9
1 changed files with 4 additions and 2 deletions
|
@ -154,13 +154,15 @@ class AnsibleNioModule:
|
|||
async def exit_json(self, **result):
|
||||
if self.module.params.get("token") is None and self.user_logout is True:
|
||||
await self.matrix_logout()
|
||||
await self.client.close()
|
||||
if not self.module.check_mode:
|
||||
await self.client.close()
|
||||
self.module.exit_json(**result)
|
||||
|
||||
async def fail_json(self, **result):
|
||||
if self.module.params.get("token") is None and self.user_logout is True:
|
||||
await self.matrix_logout()
|
||||
await self.client.close()
|
||||
if not self.module.check_mode:
|
||||
await self.client.close()
|
||||
self.module.fail_json(**result)
|
||||
|
||||
@staticmethod
|
||||
|
|
Loading…
Reference in a new issue