def get_max_database_size(host_id):
    """Return MAX_DATABASE_SIZE"""
    from physical.models import Host
    host = Host.objects.filter(id=host_id,
                               ).select_related('instance',
                                                ).select_related('databaseinfra',
                                                                 ).select_related('plan')

    try:
        host = host[0]
    except __HOLE__ as e:
        LOG.warn("Host id does not exists: {}. {}".format(host_id, e))
        return None

    return host.instance_set.all()[0].databaseinfra.plan.max_db_size
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/maintenance/registered_functions/functools.py/get_max_database_size