cloudstack: fix distinguish VPC and other networks (#18515)
This commit is contained in:
parent
2cfd6c6920
commit
ff7051bab4
1 changed files with 3 additions and 0 deletions
|
@ -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…
Reference in a new issue