From patchwork Tue Jul 26 05:07:17 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Spring Zhang X-Patchwork-Id: 3116 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 1693523F41 for ; Tue, 26 Jul 2011 05:07:20 +0000 (UTC) Received: from mail-qw0-f52.google.com (mail-qw0-f52.google.com [209.85.216.52]) by fiordland.canonical.com (Postfix) with ESMTP id B7B16A18004 for ; Tue, 26 Jul 2011 05:07:19 +0000 (UTC) Received: by qwb8 with SMTP id 8so52330qwb.11 for ; Mon, 25 Jul 2011 22:07:19 -0700 (PDT) Received: by 10.229.68.200 with SMTP id w8mr295399qci.114.1311656839201; Mon, 25 Jul 2011 22:07:19 -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.229.217.78 with SMTP id hl14cs98659qcb; Mon, 25 Jul 2011 22:07:19 -0700 (PDT) Received: by 10.216.65.129 with SMTP id f1mr382445wed.84.1311656838345; Mon, 25 Jul 2011 22:07:18 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id v44si193424wec.16.2011.07.25.22.07.17; Mon, 25 Jul 2011 22:07:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) client-ip=91.189.90.139; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.139 as permitted sender) smtp.mail=bounces@canonical.com Received: from loganberry.canonical.com ([91.189.90.37]) by adelie.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1QlZrR-0001Op-Oc for ; Tue, 26 Jul 2011 05:07:17 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id B8C9B2E8914 for ; Tue, 26 Jul 2011 05:07:17 +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: 82 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 82: restore exception information to help debug Message-Id: <20110726050717.26983.97134.launchpad@loganberry.canonical.com> Date: Tue, 26 Jul 2011 05:07:17 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13503"; Instance="initZopeless config overlay" X-Launchpad-Hash: 06ca55a6b230a5ada3c6f56c5f5f15ffd8d6784c Merge authors: Spring Zhang (qzhang) Related merge proposals: https://code.launchpad.net/~qzhang/lava-dispatcher/print-exc-info/+merge/69050 proposed by: Spring Zhang (qzhang) review: Approve - Zygmunt Krynicki (zkrynicki) ------------------------------------------------------------ revno: 82 [merge] committer: Spring Zhang branch nick: lava-dispatcher timestamp: Tue 2011-07-26 13:04:49 +0800 message: restore exception information to help debug modified: lava_dispatcher/__init__.py lava_dispatcher/actions/android_deploy.py lava_dispatcher/actions/deploy.py lava_dispatcher/actions/lava-test.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-07-25 16:18:33 +0000 +++ lava_dispatcher/__init__.py 2011-07-26 04:55:23 +0000 @@ -84,8 +84,8 @@ test_name = params.get('test_name', "Unknown") err_msg = err_msg + "Lava failed with test: " \ + test_name - exc_type, exc_value, exc_traceback = sys.exc_info() - err_msg = err_msg + repr(traceback.format_tb(exc_traceback)) + err_msg = err_msg + traceback.format_exc() + print >> sys.stderr print >> sys.stderr, err_msg else: err_msg = "" === modified file 'lava_dispatcher/actions/android_deploy.py' --- lava_dispatcher/actions/android_deploy.py 2011-07-20 10:08:14 +0000 +++ lava_dispatcher/actions/android_deploy.py 2011-07-25 09:15:42 +0000 @@ -22,7 +22,9 @@ from lava_dispatcher.actions import BaseAction from lava_dispatcher.config import LAVA_IMAGE_TMPDIR, LAVA_IMAGE_URL, MASTER_STR import os +import sys import shutil +import traceback from tempfile import mkdtemp from lava_dispatcher.utils import download, download_with_cache from lava_dispatcher.client import CriticalError @@ -41,12 +43,16 @@ try: client.wait_network_up() except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Network can't probe up when deployment") try: boot_tbz2, system_tbz2, data_tbz2 = self.download_tarballs(boot, system, data, use_cache) except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Package can't download when deployment") boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '') @@ -65,6 +71,8 @@ self.deploy_linaro_android_testrootfs(system_url) self.purge_linaro_android_sdcard() except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Android deployment failed") finally: shutil.rmtree(self.tarball_dir) === modified file 'lava_dispatcher/actions/deploy.py' --- lava_dispatcher/actions/deploy.py 2011-07-21 02:48:54 +0000 +++ lava_dispatcher/actions/deploy.py 2011-07-25 09:15:42 +0000 @@ -20,8 +20,10 @@ from commands import getoutput, getstatusoutput import os +import sys import re import shutil +import traceback from tempfile import mkdtemp from lava_dispatcher.actions import BaseAction @@ -43,12 +45,16 @@ try: client.wait_network_up() except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Network can't probe up when deployment") try: boot_tgz, root_tgz = self.generate_tarballs(hwpack, rootfs, use_cache) except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Deployment tarballs preparation failed") boot_tarball = boot_tgz.replace(LAVA_IMAGE_TMPDIR, '') root_tarball = root_tgz.replace(LAVA_IMAGE_TMPDIR, '') @@ -60,6 +66,8 @@ self.deploy_linaro_rootfs(root_url) self.deploy_linaro_bootfs(boot_url) except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise CriticalError("Deployment failed") finally: shutil.rmtree(self.tarball_dir) @@ -124,6 +132,8 @@ rc, output = getstatusoutput(cmd) if rc: shutil.rmtree(tarball_dir) + tb = traceback.format_exc() + print >> sys.stderr, tb raise RuntimeError("linaro-media-create failed: %s" % output) boot_offset = self._get_partition_offset(image_file, board.boot_part) root_offset = self._get_partition_offset(image_file, board.root_part) @@ -134,6 +144,8 @@ self._extract_partition(image_file, root_offset, root_tgz) except: shutil.rmtree(tarball_dir) + tb = traceback.format_exc() + print >> sys.stderr, tb raise return boot_tgz, root_tgz === modified file 'lava_dispatcher/actions/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2011-07-20 05:27:33 +0000 +++ lava_dispatcher/actions/lava-test.py 2011-07-25 09:15:42 +0000 @@ -21,6 +21,8 @@ # with this program; if not, see . from datetime import datetime +import sys +import traceback from lava_dispatcher.actions import BaseAction from lava_dispatcher.client import OperationFailed from lava_dispatcher.config import LAVA_RESULT_DIR, MASTER_STR, TESTER_STR @@ -94,6 +96,8 @@ 'chroot /mnt/root lava-test help', response="list-tests", timeout=10) except: + tb = traceback.format_exc() + print >> sys.stderr, tb raise OperationFailed("lava-test deployment failed") for test in tests: