New /job/JOBID/log url to see job logs
authorJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 19 Apr 2011 15:55:06 +0000 (15:55 +0000)
committerJean-Michel Nirgal Vourgère <jmv@nirgal.com>
Tue, 19 Apr 2011 15:55:06 +0000 (15:55 +0000)
bin/djais/views.py
www_templates/job_log.html [new file with mode: 0644]

index e82a9fc894ef79e8585b6747f242b11ead1d2dc8..7f29e43f5d10b996ee246e2d416a61b90e5add6e 100644 (file)
@@ -928,11 +928,11 @@ def job_log(request, jobid):
         return HttpResponseForbidden('403 Forbidden')
     log = u''
     try:
-        log = file(RESULT_DIR+unicode(jobid)+'.log').read()
+        log = file(jobrunner.RESULT_DIR+unicode(jobid)+'.log').read()
     except IOError, err:
         if err.errno != 2: # No such file
             raise
-    return render_to_response('job.html', {'job': job, 'log': log}, RequestContext(request))
+    return render_to_response('job_log.html', {'job': job, 'log': log}, RequestContext(request))
 
 
 @http_authenticate(auth, 'ais')
diff --git a/www_templates/job_log.html b/www_templates/job_log.html
new file mode 100644 (file)
index 0000000..94e8744
--- /dev/null
@@ -0,0 +1,20 @@
+{% extends "jobs.html" %}
+
+{% block breadcrumbs %}
+{{ block.super }}
+/ <a href=.>{{ job.id }}</a>
+/ log
+{% endblock %}
+
+{% block title %}
+Job {{ job.id }} log
+{% endblock %}
+
+{% block content %}
+
+<h3>Job {{ job.id }} log</h3>
+<pre>
+{{ log }}
+</pre>
+
+{% endblock %}