cs_instance: fix error when state destroyed but querying user_data

pull/37249/head
Rene Moser 7 years ago committed by René Moser
parent 6c8d40f653
commit 190d3fbbed

@ -460,7 +460,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
return instance['userdata']
user_data = ""
if self.get_user_data() is not None:
if self.get_user_data() is not None and instance.get('id'):
res = self.query_api('getVirtualMachineUserData', virtualmachineid=instance['id'])
user_data = res['virtualmachineuserdata'].get('userdata', "")
return user_data

Loading…
Cancel
Save