Adds token cleanup and fixes unit tests (#48493)

This commit is contained in:
Tim Rupp 2018-11-10 14:40:14 -08:00 committed by GitHub
commit 7d11e6e3e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 11 deletions

View file

@ -1102,12 +1102,15 @@ def main():
required_one_of=spec.required_one_of
)
client = F5RestClient(**module.params)
try:
client = F5RestClient(**module.params)
mm = ModuleManager(module=module, client=client)
results = mm.exec_module()
cleanup_tokens(client)
exit_json(module, results, client)
except F5ModuleError as ex:
cleanup_tokens(client)
fail_json(module, ex, client)