Merge pull request #705 from resmo/for-ansible

cloudstack: cs_instance: fix missing resource error in check mode if instance is not yet present
This commit is contained in:
Brian Coca 2015-07-10 12:40:39 -04:00
commit 8a89f4afe4

View file

@ -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