From patchwork Tue Sep 20 14:19:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 4200 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 D3CE623EFB for ; Tue, 20 Sep 2011 14:19:17 +0000 (UTC) Received: from mail-ey0-f180.google.com (mail-ey0-f180.google.com [209.85.215.180]) by fiordland.canonical.com (Postfix) with ESMTP id B7799A188C2 for ; Tue, 20 Sep 2011 14:19:17 +0000 (UTC) Received: by eyb6 with SMTP id 6so278281eyb.11 for ; Tue, 20 Sep 2011 07:19:17 -0700 (PDT) Received: by 10.223.74.89 with SMTP id t25mr1393037faj.65.1316528356454; Tue, 20 Sep 2011 07:19:16 -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.152.18.198 with SMTP id y6cs82983lad; Tue, 20 Sep 2011 07:19:15 -0700 (PDT) Received: by 10.227.201.79 with SMTP id ez15mr938392wbb.99.1316528354716; Tue, 20 Sep 2011 07:19:14 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id fj8si1541298wbb.54.2011.09.20.07.19.14 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 20 Sep 2011 07:19:14 -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 1R61AH-0001Y1-V0 for ; Tue, 20 Sep 2011 14:19:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E300DE06D2 for ; Tue, 20 Sep 2011 14:19:13 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-dispatcher X-Launchpad-Branch: ~linaro-validation/lava-dispatcher/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 116 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 116: Use job_name filed in the job file to set the name of the job used for a Message-Id: <20110920141913.12066.75416.launchpad@ackee.canonical.com> Date: Tue, 20 Sep 2011 14:19:13 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13980"; Instance="initZopeless config overlay" X-Launchpad-Hash: 32840b842c98398b2030ddc7d639b0f960827289 ------------------------------------------------------------ revno: 116 committer: Paul Larson branch nick: dispatcher-use-jobname2 timestamp: Mon 2011-09-19 21:35:31 -0500 message: Use job_name filed in the job file to set the name of the job used for a link in the dashboard modified: lava_dispatcher/__init__.py lava_dispatcher/actions/launch_control.py --- lp:lava-dispatcher https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk You are subscribed to branch lp:lava-dispatcher. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-dispatcher/trunk/+edit-subscription === modified file 'lava_dispatcher/__init__.py' --- lava_dispatcher/__init__.py 2011-09-09 04:34:34 +0000 +++ lava_dispatcher/__init__.py 2011-09-20 02:35:31 +0000 @@ -18,7 +18,6 @@ # along # with this program; if not, see . -import sys from datetime import datetime import json import traceback @@ -39,7 +38,8 @@ self.load_job_data(job_json) dispatcher_config = get_config("lava-dispatcher") self.context = LavaContext( - self.target, self.image_type, dispatcher_config, oob_file) + self.target, self.image_type, dispatcher_config, oob_file, + self.job_data) def load_job_data(self, job_json): self.job_data = json.loads(job_json) @@ -106,8 +106,9 @@ class LavaContext(object): - def __init__(self, target, image_type, dispatcher_config, oob_file): + def __init__(self, target, image_type, dispatcher_config, oob_file, job_data): self.config = dispatcher_config + self.job_data = job_data device_config = get_device_config(target) if device_config.get('client_type') != 'conmux': raise RuntimeError( === modified file 'lava_dispatcher/actions/launch_control.py' --- lava_dispatcher/actions/launch_control.py 2011-09-16 02:47:34 +0000 +++ lava_dispatcher/actions/launch_control.py 2011-09-20 02:35:31 +0000 @@ -42,9 +42,10 @@ f = open(bundle) content = f.read() f.close() + job_name = self.context.job_data.get('job_name', "LAVA Results") try: print >> self.context.oob_file, 'dashboard-put-result:', \ - dashboard.put_ex(content, bundle, stream) + dashboard.put_ex(content, job_name, stream) except xmlrpclib.Fault, err: print "xmlrpclib.Fault occurred" print "Fault code: %d" % err.faultCode @@ -150,8 +151,9 @@ attributes.update(self.context.test_data.get_metadata()) test_run['attributes'] = attributes json_bundle = json.dumps(main_bundle) + job_name = self.context.job_data.get('job_name', "LAVA Results") print >> self.context.oob_file, 'dashboard-put-result:', \ - dashboard.put_ex(json_bundle, 'lava-dispatcher.bundle', stream) + dashboard.put_ex(json_bundle, job_name, stream) if status == 'fail': raise OperationFailed(err_msg)