cloudstack: cs_instance: fix ip address may not be set on default nic

This commit is contained in:
Rene Moser 2015-08-23 00:01:52 +02:00 committed by Matt Clay
parent 2d9d474f23
commit 6f91273fe1

View file

@ -779,7 +779,7 @@ class AnsibleCloudStackInstance(AnsibleCloudStack):
self.result['affinity_groups'] = affinity_groups
if 'nic' in instance:
for nic in instance['nic']:
if nic['isdefault']:
if nic['isdefault'] and 'ipaddress' in nic:
self.result['default_ip'] = nic['ipaddress']
return self.result