Switch to use _get_subnet_object in neutrondb_ipam driver

Instead of using old _get_subnet() method new method
_get_subnet_object() will now be used in neutrondb_ipam
driver and because of that it will use Subnet OVO object.

Change-Id: Ie9876064da989842576eeb30804b6a991d4d2937
Partially-Implements: blueprint adopt-oslo-versioned-objects-for-db
This commit is contained in:
Sławek Kapłoński 2017-12-12 13:42:15 +01:00
parent 259eedaaba
commit 9a8a1262cf
1 changed files with 5 additions and 5 deletions

View File

@ -97,20 +97,20 @@ class NeutronDbSubnet(ipam_base.Subnet):
for pool in ipam_subnet.allocation_pools:
pools.append(netaddr.IPRange(pool['first_ip'], pool['last_ip']))
neutron_subnet = cls._fetch_subnet(ctx, neutron_subnet_id)
neutron_subnet_obj = cls._fetch_subnet(ctx, neutron_subnet_id)
return cls(ipam_subnet['id'],
ctx,
cidr=neutron_subnet['cidr'],
cidr=neutron_subnet_obj.cidr,
allocation_pools=pools,
gateway_ip=neutron_subnet['gateway_ip'],
tenant_id=neutron_subnet['tenant_id'],
gateway_ip=neutron_subnet_obj.gateway_ip,
tenant_id=neutron_subnet_obj.tenant_id,
subnet_id=neutron_subnet_id)
@classmethod
def _fetch_subnet(cls, context, id):
plugin = directory.get_plugin()
return plugin._get_subnet(context, id)
return plugin._get_subnet_object(context, id)
def __init__(self, internal_id, ctx, cidr=None,
allocation_pools=None, gateway_ip=None, tenant_id=None,