Пример #1
0
    def get_tenant(self, tenant_id):
        if self.cache.cache_exists(tenant_id, CACHE_TENANT):
            tenant_dict = jsonutils.loads(
                self.cache.cache_get(tenant_id, CACHE_TENANT))
            tenant = load_tenant_from_dict(tenant_dict)
            return tenant

        return None
Пример #2
0
def retrieve_tenant(tenant_id):
    """
    Retrieve the specified tenant form the datastore
    """
    tenant_dict = _db_handler.find_one('tenant', {'tenant_id': tenant_id})
    #return the tenant object
    if tenant_dict:
        return load_tenant_from_dict(tenant_dict)

    return None
Пример #3
0
def retrieve_tenant(tenant_id):
    """
    Retrieve the specified tenant form the datastore
    """
    tenant_dict = _db_handler.find_one('tenant', {'tenant_id': tenant_id})
    #return the tenant object
    if tenant_dict:
        return load_tenant_from_dict(tenant_dict)

    return None