tempest/scenario/manager.py
def _default_security_group(self, tenant_id, client=None):
        """Get default secgroup for given tenant_id.

        :returns: DeletableSecurityGroup -- default secgroup for given tenant
        """
        if client is None:
            client = self.network_client
        sgs = [
            sg for sg in client.list_security_groups().values()[0]
            if sg['tenant_id'] == tenant_id and sg['name'] == 'default'
        ]
        msg = "No default security group for tenant %s." % (tenant_id)
        self.assertTrue(len(sgs) > 0, msg)
        if len(sgs) > 1:
            msg = "Found %d default security groups" % len(sgs)
            raise exc.NeutronClientNoUniqueMatch(msg=msg)
        return net_common.DeletableSecurityGroup(client=client,
                                                 **sgs[0])
Get default secgroup for given tenant_id.

        :returns: DeletableSecurityGroup -- default secgroup for given tenant
        
Get default secgroup for given tenant_id.
Get default secgroup for given tenant_id .
def _default_security_group(self, tenant_id, client=None):
        if client is None:
            client = self.network_client
        sgs = [
            sg for sg in client.list_security_groups().values()[0]
            if sg['tenant_id'] == tenant_id and sg['name'] == 'default'
        ]
        msg = "No default security group for tenant %s." % (tenant_id)
        self.assertTrue(len(sgs) > 0, msg)
        if len(sgs) > 1:
            msg = "Found %d default security groups" % len(sgs)
            raise exc.NeutronClientNoUniqueMatch(msg=msg)
        return net_common.DeletableSecurityGroup(client=client,
                                                 **sgs[0])
def _default_security_group ( self , tenant_id , client = None ) : if client is None : client = self . network_client sgs = [ sg for sg in client . list_security_groups ( ) . values ( ) [ 0 ] if sg [ 'tenant_id' ] == tenant_id and sg [ 'name' ] == 'default' ] msg = "No default security group for tenant %s." % ( tenant_id ) self . assertTrue ( len ( sgs ) > 0 , msg ) if len ( sgs ) > 1 : msg = "Found %d default security groups" % len ( sgs ) raise exc . NeutronClientNoUniqueMatch ( msg = msg ) return net_common . DeletableSecurityGroup ( client = client , ** sgs [ 0 ] )
Get default secgroup for given tenant_id.
Get default secgroup for given tenant_id .
"""Get default secgroup for given tenant_id.

        :returns: DeletableSecurityGroup -- default secgroup for given tenant
        """
- default secgroup for given tenant
- default secgroup for given tenant
self
tenant_id
client