cloudstack: fix distinguish VPC and other networks (#18515)

pull/18557/head
René Moser 8 years ago committed by GitHub
parent 2cfd6c6920
commit ff7051bab4

@ -259,6 +259,9 @@ class AnsibleCloudStack(object):
self.module.fail_json(msg="No networks available.") self.module.fail_json(msg="No networks available.")
for n in networks['network']: for n in networks['network']:
# ignore any VPC network if vpc param is not given
if 'vpcid' in n and not self.get_vpc(key='id'):
continue
if network in [n['displaytext'], n['name'], n['id']]: if network in [n['displaytext'], n['name'], n['id']]:
self.network = n self.network = n
return self._get_by_key(key, self.network) return self._get_by_key(key, self.network)

Loading…
Cancel
Save