cs_instance: fix error when state destroyed but querying user_data
This commit is contained in:
parent
6c8d40f653
commit
190d3fbbed
1 changed files with 1 additions and 1 deletions
|
@ -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…
Reference in a new issue