cloud: ovirt: logout if token is not used (#21517)

This commit is contained in:
Ondra Machacek 2017-03-01 20:59:15 +01:00 committed by John R Barker
parent b2d4eeb293
commit 9fe0ae082a
39 changed files with 117 additions and 78 deletions

View file

@ -937,7 +937,8 @@ def main():
try:
state = module.params['state']
connection = create_connection(module.params.pop('auth'))
auth = module.params.pop('auth')
connection = create_connection(auth)
vms_service = connection.system_service().vms_service()
vms_module = VmsModule(
connection=connection,
@ -1053,7 +1054,7 @@ def main():
except Exception as e:
module.fail_json(msg=str(e), exception=traceback.format_exc())
finally:
connection.close(logout=False)
connection.close(logout='token' not in module.params['auth'])
if __name__ == "__main__":