tempest/scenario/manager.py
def _create_subnet(self, network, namestart='subnet-smoke-'):
        """
        Create a subnet for the given network within the cidr block
        configured for tenant networks.
        """
        cfg = self.config.network
        tenant_cidr = netaddr.IPNetwork(cfg.tenant_network_cidr)
        result = None
        # Repeatedly attempt subnet creation with sequential cidr
        # blocks until an unallocated block is found.
        for subnet_cidr in tenant_cidr.subnet(cfg.tenant_network_mask_bits):
            body = dict(
                subnet=dict(
                    ip_version=4,
                    network_id=network.id,
                    tenant_id=network.tenant_id,
                    cidr=str(subnet_cidr),
                ),
            )
            try:
                result = self.network_client.create_subnet(body=body)
                break
            except exc.NeutronClientException as e:
                is_overlapping_cidr = 'overlaps with another subnet' in str(e)
                if not is_overlapping_cidr:
                    raise
        self.assertIsNotNone(result, 'Unable to allocate tenant network')
        subnet = net_common.DeletableSubnet(client=self.network_client,
                                            **result['subnet'])
        self.assertEqual(subnet.cidr, str(subnet_cidr))
        self.set_resource(data_utils.rand_name(namestart), subnet)
        return subnet

        Create a subnet for the given network within the cidr block
        configured for tenant networks.
        
Create a subnet for the given network within the cidr block
configured for tenant networks.
Create a subnet for the given network within the cidr block configured for tenant networks .
def _create_subnet(self, network, namestart='subnet-smoke-'):
        cfg = self.config.network
        tenant_cidr = netaddr.IPNetwork(cfg.tenant_network_cidr)
        result = None
        for subnet_cidr in tenant_cidr.subnet(cfg.tenant_network_mask_bits):
            body = dict(
                subnet=dict(
                    ip_version=4,
                    network_id=network.id,
                    tenant_id=network.tenant_id,
                    cidr=str(subnet_cidr),
                ),
            )
            try:
                result = self.network_client.create_subnet(body=body)
                break
            except exc.NeutronClientException as e:
                is_overlapping_cidr = 'overlaps with another subnet' in str(e)
                if not is_overlapping_cidr:
                    raise
        self.assertIsNotNone(result, 'Unable to allocate tenant network')
        subnet = net_common.DeletableSubnet(client=self.network_client,
                                            **result['subnet'])
        self.assertEqual(subnet.cidr, str(subnet_cidr))
        self.set_resource(data_utils.rand_name(namestart), subnet)
        return subnet
def _create_subnet ( self , network , namestart = 'subnet-smoke-' ) : cfg = self . config . network tenant_cidr = netaddr . IPNetwork ( cfg . tenant_network_cidr ) result = None for subnet_cidr in tenant_cidr . subnet ( cfg . tenant_network_mask_bits ) : body = dict ( subnet = dict ( ip_version = 4 , network_id = network . id , tenant_id = network . tenant_id , cidr = str ( subnet_cidr ) , ) , ) try : result = self . network_client . create_subnet ( body = body ) break except exc . NeutronClientException as e : is_overlapping_cidr = 'overlaps with another subnet' in str ( e ) if not is_overlapping_cidr : raise self . assertIsNotNone ( result , 'Unable to allocate tenant network' ) subnet = net_common . DeletableSubnet ( client = self . network_client , ** result [ 'subnet' ] ) self . assertEqual ( subnet . cidr , str ( subnet_cidr ) ) self . set_resource ( data_utils . rand_name ( namestart ) , subnet ) return subnet
Create a subnet for the given network within the cidr block
configured for tenant networks.
Create a subnet for the given network within the cidr block configured for tenant networks .
"""
        Create a subnet for the given network within the cidr block
        configured for tenant networks.
        """ # Repeatedly attempt subnet creation with sequential cidr # blocks until an unallocated block is found.
self
network
namestart