From patchwork Thu Jan 12 23:06:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 6170 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 5E8F223F7F for ; Thu, 12 Jan 2012 23:06:17 +0000 (UTC) Received: from mail-bk0-f52.google.com (mail-bk0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3E51BA181D4 for ; Thu, 12 Jan 2012 23:06:17 +0000 (UTC) Received: by bkbzu5 with SMTP id zu5so2274994bkb.11 for ; Thu, 12 Jan 2012 15:06:17 -0800 (PST) Received: by 10.204.38.80 with SMTP id a16mr1938898bke.99.1326409576726; Thu, 12 Jan 2012 15:06:16 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.205.82.144 with SMTP id ac16cs16663bkc; Thu, 12 Jan 2012 15:06:16 -0800 (PST) Received: by 10.180.19.168 with SMTP id g8mr10194312wie.4.1326409575129; Thu, 12 Jan 2012 15:06:15 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id g8si4753459wiy.37.2012.01.12.15.06.15 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 12 Jan 2012 15:06:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1RlTio-0008Pn-To for ; Thu, 12 Jan 2012 23:06:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id D87ABE0837 for ; Thu, 12 Jan 2012 23:06:14 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-scheduler X-Launchpad-Branch: ~linaro-validation/lava-scheduler/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 111 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 111: improvements to the job view when there is no log file Message-Id: <20120112230614.20119.69051.launchpad@ackee.canonical.com> Date: Thu, 12 Jan 2012 23:06:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14664"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 02484b4bc81fbcc170472734c40b1d4d54ff5270 Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-scheduler/no-log-file-bug-914731/+merge/88281 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 111 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Fri 2012-01-13 12:04:15 +1300 message: improvements to the job view when there is no log file modified: lava_scheduler_app/logfile_helper.py lava_scheduler_app/templates/lava_scheduler_app/job.html lava_scheduler_app/templates/lava_scheduler_app/job_sidebar.html lava_scheduler_app/views.py --- lp:lava-scheduler https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk You are subscribed to branch lp:lava-scheduler. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-scheduler/trunk/+edit-subscription === modified file 'lava_scheduler_app/logfile_helper.py' --- lava_scheduler_app/logfile_helper.py 2011-12-13 04:22:40 +0000 +++ lava_scheduler_app/logfile_helper.py 2012-01-11 22:09:33 +0000 @@ -1,9 +1,6 @@ -import os import re def getDispatcherErrors(logfile): - if not logfile: - return "Log file is missing" errors = "" for line in logfile: if line.find("CriticalError:") != -1 or \ @@ -12,18 +9,7 @@ return errors -def getDispatcherLogSize(logfile): - if not logfile: - return 0 - else: - logfile.seek(0, os.SEEK_END) - size = logfile.tell() - return size - def getDispatcherLogMessages(logfile): - if not logfile: - return ('', "Log file is missing") - logs = [] log_prefix = '' level_pattern = re.compile('....-..-.. ..:..:.. .. ([A-Z]+):') === modified file 'lava_scheduler_app/templates/lava_scheduler_app/job.html' --- lava_scheduler_app/templates/lava_scheduler_app/job.html 2011-12-15 20:55:43 +0000 +++ lava_scheduler_app/templates/lava_scheduler_app/job.html 2012-01-11 22:20:43 +0000 @@ -8,6 +8,10 @@ {% block content %}

Dispatcher Log Summary

+{% if job.status < job.RUNNING %} +No log file yet. +{% else %} +{% if job_file_present %} {% if job_has_error %}

Dispatcher error or test failure

@@ -32,8 +36,14 @@ {% endif %}
+{% else %} +

+Job file missing. +

+{% endif %} +{% endif %} -