X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=snaps%2Fopenstack%2Fcreate_network.py;h=c3fb5752bdd56a90403d2614d15352d91e9f3d5c;hb=430905e7f76e4a074167a49ca2bfbf727eebcefd;hp=4caef1283732da4bdfee49b660bc79d7c6f1e17e;hpb=652da5487159d5ee94fe2f8e62c34fdb0d26f4e5;p=snaps.git diff --git a/snaps/openstack/create_network.py b/snaps/openstack/create_network.py index 4caef12..c3fb575 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,10 +463,9 @@ 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']) - if subnet: + subnet = neutron_utils.get_subnet( + neutron, subnet_name=ip_addr_dict['subnet_name']) + if subnet and 'ip' in ip_addr_dict: self.fixed_ips.append({'ip_address': ip_addr_dict['ip'], 'subnet_id': subnet.id}) else: