From patchwork Thu Sep 12 14:46:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Senthil Kumaran X-Patchwork-Id: 20005 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CA28520357 for ; Thu, 12 Sep 2013 14:46:27 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id oy12sf11220134veb.7 for ; Thu, 12 Sep 2013 07:46:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mime-version:to:from:subject :message-id:date:reply-to:sender:errors-to:precedence :x-original-sender:x-original-authentication-results:mailing-list :list-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=b5FQKJNziBC2ZzRzsbTM3vnf9lBDaDj7dnoSLej2WCA=; b=T4Iue7PzZHuevFgn8jVAKPn8MfpQZgbvppYFS4QHqyCrS6xianwrzDXJ0lCrPzTWqU duLp3QQUBedVP/Lvrvg2XeRkotSUSutRsCstjxkxQnc2n6/wuc4w8L9awUm8e9PieXt3 eIBrK5/rE/x/0jRZVGHPBWsgHjy882ZYKbeN1SMcR94e1aJbtDWkPEJolXjPzEixt6Rs y0uJ6TXhx6AQBiwP8Zs7lLYgf1NZLEw7HV1KjDxSAZF087JKsXjW7WmhTTFNc8ciMWhL FiDUJak8m3et3An8ryoktOEK0uQou9V0Dn6cy9V09YNbTh41xQfgBOgMD4Fd0tDnkMPP QnOw== X-Gm-Message-State: ALoCoQlz3ykrEKEjUihRlr7VPr2tpNlOsDC7icvoZf8CN82D+Rii01kmjiqMDPMfYU6eAwr5Bne1 X-Received: by 10.236.172.34 with SMTP id s22mr2927126yhl.25.1378997186908; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.26.102 with SMTP id k6ls772598qeg.5.gmail; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) X-Received: by 10.58.146.71 with SMTP id ta7mr1971050veb.23.1378997186615; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) Received: from mail-vc0-f177.google.com (mail-vc0-f177.google.com [209.85.220.177]) by mx.google.com with ESMTPS id oh2si1327421vcb.85.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Sep 2013 07:46:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.177; Received: by mail-vc0-f177.google.com with SMTP id gf12so7216164vcb.36 for ; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) X-Received: by 10.52.163.234 with SMTP id yl10mr191244vdb.47.1378997186495; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp25001vcz; Thu, 12 Sep 2013 07:46:26 -0700 (PDT) X-Received: by 10.180.160.240 with SMTP id xn16mr22178438wib.62.1378997185442; Thu, 12 Sep 2013 07:46:25 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id de7si2594748wjc.82.1969.12.31.16.00.00 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 12 Sep 2013 07:46:25 -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; Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1VK8A4-00064z-2l for ; Thu, 12 Sep 2013 14:46:24 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id F0D3CF3044 for ; Thu, 12 Sep 2013 14:46:23 +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: 265 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-scheduler/trunk] Rev 265: Fix bug #1224261 - submitting a multinode job for a device_type with no Message-Id: <20130912144623.30669.25132.launchpad@ackee.canonical.com> Date: Thu, 12 Sep 2013 14:46:23 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: list X-Generated-By: Launchpad (canonical.com); Revision="16761"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: d238503cec6927907e2c09b3ef4484bd0213272c X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: noreply@launchpad.net X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.177 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Merge authors: Senthil Kumaran S (stylesen) Related merge proposals: https://code.launchpad.net/~stylesen/lava-scheduler/fix-bug-1224261/+merge/185207 proposed by: Senthil Kumaran S (stylesen) review: Approve - Neil Williams (codehelp) ------------------------------------------------------------ revno: 265 [merge] committer: Senthil Kumaran branch nick: trunk timestamp: Thu 2013-09-12 20:15:31 +0530 message: Fix bug #1224261 - submitting a multinode job for a device_type with no boards fails. modified: lava_scheduler_app/models.py 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/models.py' --- lava_scheduler_app/models.py 2013-09-04 14:46:59 +0000 +++ lava_scheduler_app/models.py 2013-09-12 06:28:07 +0000 @@ -81,7 +81,7 @@ continue else: raise DevicesUnavailableException( - "Requested %d %s device(s) - only %d available." % (count, board, all_devices[board])) + "Requested %d %s device(s) - only %d available." % (count, board, all_devices.get(board,0))) return True === modified file 'lava_scheduler_app/views.py' --- lava_scheduler_app/views.py 2013-09-02 15:14:15 +0000 +++ lava_scheduler_app/views.py 2013-09-12 06:28:07 +0000 @@ -53,6 +53,7 @@ TestJob, JSONDataError, validate_job_json, + DevicesUnavailableException, ) @@ -606,7 +607,8 @@ "lava_scheduler_app/job_submit.html", response_data, RequestContext(request)) - except (JSONDataError, ValueError) as e: + except (JSONDataError, ValueError, DevicesUnavailableException) \ + as e: response_data["error"] = str(e) response_data["json_input"] = request.POST.get("json-input") return render_to_response( @@ -842,7 +844,7 @@ response_data, RequestContext(request)) else: return redirect(job) - except Exception as e: + except (JSONDataError, ValueError, DevicesUnavailableException) as e: response_data["error"] = str(e) response_data["json_input"] = definition return render_to_response(