

def _make_subnet_args(self, detail, subnet, subnetpool_id):
    gateway_ip = (str(detail.gateway_ip) if detail.gateway_ip else None)
    args = {
        'tenant_id': detail.tenant_id,
        'id': detail.subnet_id,
        'name': subnet['name'],
        'network_id': subnet['network_id'],
        'ip_version': subnet['ip_version'],
        'cidr': str(detail.subnet_cidr),
        'subnetpool_id': subnetpool_id,
        'enable_dhcp': subnet['enable_dhcp'],
        'gateway_ip': gateway_ip,
        'description': subnet.get('description'),
    }
    if ((subnet['ip_version'] == 6) and subnet['enable_dhcp']):
        if validators.is_attr_set(subnet['ipv6_ra_mode']):
            args['ipv6_ra_mode'] = subnet['ipv6_ra_mode']
        if validators.is_attr_set(subnet['ipv6_address_mode']):
            args['ipv6_address_mode'] = subnet['ipv6_address_mode']
    return args

dataset/ETHPy150Open openstack/neutron/neutron/db/db_base_plugin_common.py DbBasePluginCommon._make_subnet_args/original