

def _make_subnet_dict(self, subnet, fields=None, context=None):
    res = {
        'id': subnet['id'],
        'name': subnet['name'],
        'tenant_id': subnet['tenant_id'],
        'network_id': subnet['network_id'],
        'ip_version': subnet['ip_version'],
        'cidr': subnet['cidr'],
        'subnetpool_id': subnet.get('subnetpool_id'),
        'allocation_pools': [{
            'start': pool['first_ip'],
            'end': pool['last_ip'],
        } for pool in subnet['allocation_pools']],
        'gateway_ip': subnet['gateway_ip'],
        'enable_dhcp': subnet['enable_dhcp'],
        'ipv6_ra_mode': subnet['ipv6_ra_mode'],
        'ipv6_address_mode': subnet['ipv6_address_mode'],
        'dns_nameservers': [dns['address'] for dns in subnet['dns_nameservers']],
        'host_routes': [{
            'destination': route['destination'],
            'nexthop': route['nexthop'],
        } for route in context['routes']],
    }
    res['shared'] = self._is_network_shared(context, subnet.networks)
    self._apply_dict_extend_functions(attributes.SUBNETS, res, subnet)
    return self._fields(res, fields)

dataset/ETHPy150Open openstack/neutron/neutron/db/db_base_plugin_common.py DbBasePluginCommon._make_subnet_dict/VarMisuse@188/328 `subnet`->`context`