summaryrefslogtreecommitdiffstats
path: root/snaps/openstack/create_network.py
diff options
context:
space:
mode:
authorspisarski <s.pisarski@cablelabs.com>2017-08-03 13:23:39 -0600
committerspisarski <s.pisarski@cablelabs.com>2017-08-04 14:08:59 -0600
commite73caa67417ab6c628cf8fac1ac730e550de7bbc (patch)
treecf7b93e06f8a27c817a675a7c85b23c5fe5bd875 /snaps/openstack/create_network.py
parent3688eb42266a2a96a16eb140eebf6f86a7bc126b (diff)
Refactored neutron_utils#get_subnet_by_name() to get_subnet()
Renamed utility function and added a subnet_settings parameter to hold a SubnetSettings object to help make the query more robust by being able to leverage values on the settings object. JIRA: SNAPS-165 Change-Id: I226a1217dc4ba7bb50f7d985ecfaf3b7bc4f610b Signed-off-by: spisarski <s.pisarski@cablelabs.com>
Diffstat (limited to 'snaps/openstack/create_network.py')
-rw-r--r--snaps/openstack/create_network.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/snaps/openstack/create_network.py b/snaps/openstack/create_network.py
index 4caef12..711367c 100644
--- a/snaps/openstack/create_network.py
+++ b/snaps/openstack/create_network.py
@@ -71,8 +71,8 @@ class OpenStackNetwork:
logger.debug('Creating Subnets....')
for subnet_setting in self.network_settings.subnet_settings:
- sub_inst = neutron_utils.get_subnet_by_name(
- self.__neutron, subnet_setting.name)
+ sub_inst = neutron_utils.get_subnet(
+ self.__neutron, subnet_settings=subnet_setting)
if sub_inst:
self.__subnets.append(sub_inst)
logger.debug(
@@ -463,9 +463,8 @@ class PortSettings:
self.fixed_ips = list()
for ip_addr_dict in self.ip_addrs:
- subnet = neutron_utils.get_subnet_by_name(neutron,
- ip_addr_dict[
- 'subnet_name'])
+ subnet = neutron_utils.get_subnet(
+ neutron, subnet_name=ip_addr_dict['subnet_name'])
if subnet:
self.fixed_ips.append({'ip_address': ip_addr_dict['ip'],
'subnet_id': subnet.id})