'Get default secgroup for given tenant_id.
:returns: default secgroup for given tenant'

def _default_security_group(self, client=None, tenant_id=None):

    if (client is None):
        client = self.security_groups_client
    if (not tenant_id):
        tenant_id = client.tenant_id
    sgs = [sg for sg in list(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.assertNotEmpty(sgs, msg)
    return sgs[0]
