Ejemplo n.º 1
0
def container_logs(request, host, container_id):
    '''
    Gets the specified container logs

    '''
    h = Host.objects.get(name=host)
    c = Container.objects.get(container_id=container_id)
    logs = h.get_container_logs(container_id).strip()
    # format
    if logs:
        logs = utils.convert_ansi_to_html(logs)
    else:
        logs = None
    ctx = {'container': c, 'logs': logs}
    return render_to_response('containers/container_logs.html',
                              ctx,
                              context_instance=RequestContext(request))
Ejemplo n.º 2
0
def container_logs(request, host, container_id):
    '''
    Gets the specified container logs

    '''
    h = Host.objects.get(name=host)
    c = Container.objects.get(container_id=container_id)
    logs = h.get_container_logs(container_id).strip()
    # format
    if logs:
        logs = utils.convert_ansi_to_html(logs)
    else:
        logs = None
    ctx = {
        'container': c,
        'logs': logs
    }
    return render_to_response('containers/container_logs.html', ctx,
        context_instance=RequestContext(request))