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):