From patchwork Thu Feb 2 01:58:10 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: 6555 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 BBE8123F8D for ; Thu, 2 Feb 2012 01:58:13 +0000 (UTC) Received: from mail-tul01m020-f180.google.com (mail-tul01m020-f180.google.com [209.85.214.180]) by fiordland.canonical.com (Postfix) with ESMTP id 55405A181D2 for ; Thu, 2 Feb 2012 01:58:13 +0000 (UTC) Received: by obbuo19 with SMTP id uo19so2915393obb.11 for ; Wed, 01 Feb 2012 17:58:12 -0800 (PST) Received: by 10.50.156.196 with SMTP id wg4mr1152376igb.13.1328147892719; Wed, 01 Feb 2012 17:58:12 -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.231.169.210 with SMTP id a18cs33859ibz; Wed, 1 Feb 2012 17:58:12 -0800 (PST) Received: by 10.180.95.131 with SMTP id dk3mr14774307wib.6.1328147891332; Wed, 01 Feb 2012 17:58:11 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id s34si565302weq.113.2012.02.01.17.58.10 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 01 Feb 2012 17:58:11 -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 1RslwA-00029Q-Oy for ; Thu, 02 Feb 2012 01:58:10 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id AF958E04EB for ; Thu, 2 Feb 2012 01:58:10 +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: 216 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 216: fix bug 921632: still submit some results even if retrieve_results blows up Message-Id: <20120202015810.1746.17441.launchpad@ackee.canonical.com> Date: Thu, 02 Feb 2012 01:58:10 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14738"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 25948858ca2a1efef22eecd5aed97a4a1ca96469 ------------------------------------------------------------ revno: 216 committer: Michael Hudson-Doyle branch nick: trunk timestamp: Thu 2012-02-02 14:56:11 +1300 message: fix bug 921632: still submit some results even if retrieve_results blows up modified: 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/actions/launch_control.py' --- lava_dispatcher/actions/launch_control.py 2012-01-09 23:20:01 +0000 +++ lava_dispatcher/actions/launch_control.py 2012-02-02 01:56:11 +0000 @@ -107,24 +107,29 @@ :param stream: Stream on the lava-dashboard server to save the result to """ - status, err_msg, result_path = self.client.retrieve_results(result_disk) - if result_path is not None: - try: - tar = tarfile.open(result_path) - for tarinfo in tar: - if os.path.splitext(tarinfo.name)[1] == ".bundle": - f = tar.extractfile(tarinfo) - content = f.read() - f.close() - self.all_bundles.append(json.loads(content)) - tar.close() - except: - logging.warning(traceback.format_exc()) - status = 'fail' - err_msg = err_msg + " Some test case result appending failed." - logging.warning(err_msg) - finally: - shutil.rmtree(os.path.dirname(result_path)) + err_msg = None + status = 'fail' + try: + status, err_msg, result_path = self.client.retrieve_results(result_disk) + if result_path is not None: + try: + tar = tarfile.open(result_path) + for tarinfo in tar: + if os.path.splitext(tarinfo.name)[1] == ".bundle": + f = tar.extractfile(tarinfo) + content = f.read() + f.close() + self.all_bundles.append(json.loads(content)) + tar.close() + except: + logging.warning(traceback.format_exc()) + status = 'fail' + err_msg = err_msg + " Some test case result appending failed." + logging.warning(err_msg) + finally: + shutil.rmtree(os.path.dirname(result_path)) + except: + logging.exception('retrieve_results failed') if err_msg is None: err_msg = ''