@classmethod
    def create_subnet(cls, network, gateway='', cidr=None, mask_bits=None,
                      ip_version=None, client=None, **kwargs):

        # allow tests to use admin client
        if not client:
            client = cls.client

        # The cidr and mask_bits depend on the ip version.
        ip_version = ip_version if ip_version is not None else cls._ip_version
        gateway_not_set = gateway == ''
        if ip_version == 4:
            cidr = cidr or netaddr.IPNetwork(
                config.safe_get_config_value(
                    'network', 'project_network_cidr'))
            mask_bits = (
                mask_bits or config.safe_get_config_value(
                    'network', 'project_network_mask_bits'))
        elif ip_version == 6:
            cidr = (
                cidr or netaddr.IPNetwork(
                    config.safe_get_config_value(
                        'network', 'project_network_v6_cidr')))
            mask_bits = (
                mask_bits or config.safe_get_config_value(
                    'network', 'project_network_v6_mask_bits'))
        # Find a cidr that is not in use yet and create a subnet with it
        for subnet_cidr in cidr.subnet(mask_bits):
            if gateway_not_set:
                gateway_ip = str(netaddr.IPAddress(subnet_cidr) + 1)
            else:
                gateway_ip = gateway
            try:
                body = client.create_subnet(
                    network_id=network['id'],
                    cidr=str(subnet_cidr),
                    ip_version=ip_version,
                    gateway_ip=gateway_ip,
                    **kwargs)
                break
            except lib_exc.BadRequest as e:
                is_overlapping_cidr = 'overlaps with another subnet' in str(e)
                if not is_overlapping_cidr:
                    raise
        else:
            message = 'Available CIDR for subnet creation could not be found'
            raise ValueError(message)
        subnet = body['subnet']
        cls.subnets.append(subnet)
        return subnet
Set the line style of the underlying widget.
dataset/ETHPy150Open openstack/neutron/neutron/tests/tempest/api/base.py/BaseNetworkTest.create_subnet--crossover with--dataset/ETHPy150Open ContinuumIO/ashiba/enaml/enaml/qt/qt_separator.py/QtSeparator.set_line_style