def get_there_is_backup_log_config(host_id):
    """Return THERE_IS_BACKUP_LOG_CONFIG"""
    from django.core.exceptions import ObjectDoesNotExist
    from physical.models import Host
    from backup.models import LogConfiguration

    host = Host.objects.filter(id=host_id,
                               ).select_related('instance').select_related('databaseinfra')

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

    databaseinfra = host.instance_set.all()[0].databaseinfra

    try:
        LogConfiguration.objects.get(environment=databaseinfra.environment,
                                     engine_type=databaseinfra.engine.engine_type)
    except ObjectDoesNotExist:
        return None

    for intance in host.instance_set.all():
        if intance.instance_type in (intance.MYSQL, intance.MONGODB, intance.REDIS):
            return True

    return False
dataset/ETHPy150Open globocom/database-as-a-service/dbaas/maintenance/registered_functions/functools.py/get_there_is_backup_log_config/original