1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: cs_role: fix UnboundLocalError in check mode

This commit is contained in:
Rene Moser 2017-07-13 23:35:48 +02:00 committed by René Moser
parent 3a1b84153c
commit 6d81c9670f

View file

@ -171,11 +171,11 @@ class AnsibleCloudStackRole(AnsibleCloudStack):
res = self.cs.updateRole(**args)
if 'errortext' in res:
self.module.fail_json(msg="Failed: '%s'" % res['errortext'])
# The API as in 4.9 does not return an updated role yet
if 'role' not in res:
role = self.get_role()
else:
role = res['role']
# The API as in 4.9 does not return an updated role yet
if 'role' not in res:
role = self.get_role()
else:
role = res['role']
return role
def absent_role(self):