From patchwork Mon Sep 17 02:57:11 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: 11454 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 C786E23E29 for ; Mon, 17 Sep 2012 02:57:15 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0A4DAA18CE6 for ; Mon, 17 Sep 2012 02:57:14 +0000 (UTC) Received: by iafj25 with SMTP id j25so4811267iaf.11 for ; Sun, 16 Sep 2012 19:57:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=+T+ZzGG9s+z6XnYsmkqeseh0WLKyIenRGSx9CH8e1Pc=; b=fp1ezbnUVrwwxFv+wrmAk/VEy9EP+8WDFVU5k+9Y7oLv6I6oc2R2jN4ZafqAmZQIjl YylxnzMOh0gwi1LfwDZbcNQRK/TUNt7+kPgizC/EsSuN2/5WtbeOs3MXwWM5kkW0YMK1 FCm6MIUuHdmrIWO6+wRr78fgG+Lv02nQjFAMqw2QSAznD91n6fTLBWmnghiH63VoAVzx K5A2GtWx0wc/UZfAAGrlpc41PZvIOA18Vic0Xpwdgj1SDy+ThrDQEb23JKk4+aItLAEM jxvAsU3CEnKCZKQoc1eFuBV6xB/mak+Mu9Nll6gZFSFrLAYQmbvTRgi0nkErWVPkCFOC ZuXQ== Received: by 10.50.242.3 with SMTP id wm3mr5470663igc.0.1347850634433; Sun, 16 Sep 2012 19:57:14 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp292850igc; Sun, 16 Sep 2012 19:57:13 -0700 (PDT) Received: by 10.180.82.39 with SMTP id f7mr12950732wiy.2.1347850632760; Sun, 16 Sep 2012 19:57:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id o7si16993615wiz.31.2012.09.16.19.57.11 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 16 Sep 2012 19:57:12 -0700 (PDT) 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 1TDRWJ-0006oN-Hx for ; Mon, 17 Sep 2012 02:57:11 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 791FBE03B8 for ; Mon, 17 Sep 2012 02:57:11 +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: 211 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 211: fix job page for jobs with no log file (as opposed to a missing log file) Message-Id: <20120917025711.2888.18307.launchpad@ackee.canonical.com> Date: Mon, 17 Sep 2012 02:57:11 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="15944"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 66817e9b4feb2c87ddc202f27fb121fb0b336bd3 X-Gm-Message-State: ALoCoQnEkThrIvUhqZQSFiduivln53Bw8oh6uMpsTh69PDi0GYDsbA/rJye/TYzZ4jnJCAu0BfrU ------------------------------------------------------------ revno: 211 committer: Michael Hudson-Doyle branch nick: trunk timestamp: Mon 2012-09-17 14:56:42 +1200 message: fix job page for jobs with no log file (as opposed to a missing log file) modified: 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/views.py' --- lava_scheduler_app/views.py 2012-08-26 23:52:54 +0000 +++ lava_scheduler_app/views.py 2012-09-17 02:56:42 +0000 @@ -490,10 +490,11 @@ } log_file = job.log_file - try: - log_file.open() - except IOError: - log_file = None + if log_file: + try: + log_file.open() + except IOError: + log_file = None if log_file: job_errors = getDispatcherErrors(log_file) @@ -525,10 +526,11 @@ def job_definition(request, pk): job = get_restricted_job(request.user, pk) log_file = job.log_file - try: - log_file.open() - except IOError: - log_file = None + if log_file: + try: + log_file.open() + except IOError: + log_file = None return render_to_response( "lava_scheduler_app/job_definition.html", {