From patchwork Thu Aug 4 22:05:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Larson X-Patchwork-Id: 3277 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 5D39D2406F for ; Thu, 4 Aug 2011 22:05:45 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0B3DFA1853E for ; Thu, 4 Aug 2011 22:05:44 +0000 (UTC) Received: by qyk31 with SMTP id 31so802623qyk.11 for ; Thu, 04 Aug 2011 15:05:44 -0700 (PDT) Received: by 10.229.68.97 with SMTP id u33mr1139407qci.159.1312495543553; Thu, 04 Aug 2011 15:05:43 -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.6.73 with SMTP id 9cs27642qcy; Thu, 4 Aug 2011 15:05:42 -0700 (PDT) Received: by 10.216.133.194 with SMTP id q44mr1175098wei.56.1312495541883; Thu, 04 Aug 2011 15:05:41 -0700 (PDT) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id r50si4806816weq.85.2011.08.04.15.05.41; Thu, 04 Aug 2011 15:05:41 -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 1Qp62v-0006JK-CB for ; Thu, 04 Aug 2011 22:05:41 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 572E32E8019 for ; Thu, 4 Aug 2011 22:05:41 +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: 83 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 83: fix logging of some error messages Message-Id: <20110804220541.15832.15543.launchpad@loganberry.canonical.com> Date: Thu, 04 Aug 2011 22:05:41 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="13604"; Instance="initZopeless config overlay" X-Launchpad-Hash: 225fec8a413617935a247ca929c136373efe060e Merge authors: Spring Zhang (qzhang) Related merge proposals: https://code.launchpad.net/~qzhang/lava-dispatcher/print-exc-info-v2/+merge/70410 proposed by: Spring Zhang (qzhang) review: Approve - Paul Larson (pwlars) ------------------------------------------------------------ revno: 83 [merge] committer: Paul Larson branch nick: lava-dispatcher timestamp: Thu 2011-08-04 23:03:32 +0100 message: fix logging of some error messages 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-26 04:55:23 +0000 +++ lava_dispatcher/__init__.py 2011-08-04 07:19:53 +0000 @@ -85,8 +85,8 @@ err_msg = err_msg + "Lava failed with test: " \ + test_name err_msg = err_msg + traceback.format_exc() - print >> sys.stderr - print >> sys.stderr, err_msg + # output to both serial log and logfile + self.context.client.sio.write(err_msg) else: err_msg = "" self.context.test_data.add_result(cmd['command'], === modified file 'lava_dispatcher/actions/android_deploy.py' --- lava_dispatcher/actions/android_deploy.py 2011-07-25 09:15:42 +0000 +++ lava_dispatcher/actions/android_deploy.py 2011-08-04 07:19:53 +0000 @@ -44,7 +44,7 @@ client.wait_network_up() except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise CriticalError("Network can't probe up when deployment") try: @@ -52,7 +52,7 @@ system, data, use_cache) except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise CriticalError("Package can't download when deployment") boot_tarball = boot_tbz2.replace(LAVA_IMAGE_TMPDIR, '') @@ -72,7 +72,7 @@ self.purge_linaro_android_sdcard() except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(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-25 09:15:42 +0000 +++ lava_dispatcher/actions/deploy.py 2011-08-04 07:19:53 +0000 @@ -46,7 +46,7 @@ client.wait_network_up() except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise CriticalError("Network can't probe up when deployment") try: @@ -54,7 +54,7 @@ use_cache) except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise CriticalError("Deployment tarballs preparation failed") boot_tarball = boot_tgz.replace(LAVA_IMAGE_TMPDIR, '') root_tarball = root_tgz.replace(LAVA_IMAGE_TMPDIR, '') @@ -67,7 +67,7 @@ self.deploy_linaro_bootfs(boot_url) except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise CriticalError("Deployment failed") finally: shutil.rmtree(self.tarball_dir) @@ -133,7 +133,7 @@ if rc: shutil.rmtree(tarball_dir) tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(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) @@ -145,7 +145,7 @@ except: shutil.rmtree(tarball_dir) tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise return boot_tgz, root_tgz === modified file 'lava_dispatcher/actions/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2011-07-25 09:15:42 +0000 +++ lava_dispatcher/actions/lava-test.py 2011-08-04 07:19:53 +0000 @@ -97,7 +97,7 @@ response="list-tests", timeout=10) except: tb = traceback.format_exc() - print >> sys.stderr, tb + client.sio.write(tb) raise OperationFailed("lava-test deployment failed") for test in tests: