1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

cloudstack: cs_network: cleanup dublicate VPC code (#3393)

Code has been moved to module utils, also see fe05c5e35a
This commit is contained in:
René Moser 2016-11-09 08:16:39 +01:00 committed by Matt Clay
parent e93bdb80d3
commit e1c0d2dd09

View file

@ -345,25 +345,6 @@ class AnsibleCloudStackNetwork(AnsibleCloudStack):
self.network = None
def get_vpc(self, key=None):
vpc = self.module.params.get('vpc')
if not vpc:
return None
args = {}
args['account'] = self.get_account(key='name')
args['domainid'] = self.get_domain(key='id')
args['projectid'] = self.get_project(key='id')
args['zoneid'] = self.get_zone(key='id')
vpcs = self.cs.listVPCs(**args)
if vpcs:
for v in vpcs['vpc']:
if vpc in [ v['name'], v['displaytext'], v['id'] ]:
return self._get_by_key(key, v)
self.module.fail_json(msg="VPC '%s' not found" % vpc)
def get_network_offering(self, key=None):
network_offering = self.module.params.get('network_offering')
if not network_offering: