cloudstack: cs_instance: fix missing resource error in check mode if instance is not yet present

reviewable/pr18780/r1
Rene Moser 9 years ago
parent 5713cc5ee9
commit 1ccb21bd18

@ -485,8 +485,10 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
instance = self.deploy_instance()
else:
instance = self.update_instance(instance)
instance = self.ensure_tags(resource=instance, resource_type='UserVm')
# In check mode, we do not necessarely have an instance
if instance:
instance = self.ensure_tags(resource=instance, resource_type='UserVm')
return instance

Loading…
Cancel
Save