From patchwork Tue Oct 18 02:51:12 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael-Doyle Hudson X-Patchwork-Id: 4717 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 53A3023DEF for ; Tue, 18 Oct 2011 02:51:18 +0000 (UTC) Received: from mail-bw0-f52.google.com (mail-bw0-f52.google.com [209.85.214.52]) by fiordland.canonical.com (Postfix) with ESMTP id 38335A180A7 for ; Tue, 18 Oct 2011 02:51:18 +0000 (UTC) Received: by bkbzs2 with SMTP id zs2so345731bkb.11 for ; Mon, 17 Oct 2011 19:51:18 -0700 (PDT) Received: by 10.223.17.3 with SMTP id q3mr901484faa.28.1318906277855; Mon, 17 Oct 2011 19:51:17 -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.1.71 with SMTP id 7cs29334lak; Mon, 17 Oct 2011 19:51:17 -0700 (PDT) Received: by 10.216.15.14 with SMTP id e14mr4867562wee.21.1318906273505; Mon, 17 Oct 2011 19:51:13 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id n58si294746weq.81.2011.10.17.19.51.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Oct 2011 19:51:13 -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 1RFzlo-00057e-WE for ; Tue, 18 Oct 2011 02:51:13 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id E79E2E004C for ; Tue, 18 Oct 2011 02:51:12 +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: 136 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 136: sprinkle logging.exceptions around every except: that could swallow a traceback Message-Id: <20111018025112.508.7261.launchpad@ackee.canonical.com> Date: Tue, 18 Oct 2011 02:51:12 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14157"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: b3e96775aaba79b26f38eb0a7bcff932e46ab0d8 Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/less-total-error-obscuring/+merge/79643 proposed by: Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 136 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Tue 2011-10-18 15:49:38 +1300 message: sprinkle logging.exceptions around every except: that could swallow a traceback modified: lava_dispatcher/actions/android_basic.py lava_dispatcher/actions/boot_control.py lava_dispatcher/actions/launch_control.py lava_dispatcher/actions/lava-test.py lava_dispatcher/android_client.py lava_dispatcher/client.py lava_dispatcher/utils.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/android_basic.py' --- lava_dispatcher/actions/android_basic.py 2011-09-12 22:31:47 +0000 +++ lava_dispatcher/actions/android_basic.py 2011-10-18 02:38:34 +0000 @@ -114,6 +114,7 @@ else: test_case_result['result'] = "unknown" except: + logging.exception("getprop sys.boot_completed failed") test_case_result['result'] = "fail" pass === modified file 'lava_dispatcher/actions/boot_control.py' --- lava_dispatcher/actions/boot_control.py 2011-09-23 02:53:30 +0000 +++ lava_dispatcher/actions/boot_control.py 2011-10-18 02:38:34 +0000 @@ -35,6 +35,7 @@ try: client.boot_linaro_android_image() except: + logging.exception("boot_linaro_android_image failed") raise CriticalError("Failed to boot test image.") class cmd_boot_linaro_image(BaseAction): @@ -49,6 +50,7 @@ logging.info("Boot Linaro image") client.boot_linaro_image() except: + logging.exception("boot_linaro_image failed") status = 'fail' raise CriticalError("Failed to boot test image.") finally: === modified file 'lava_dispatcher/actions/launch_control.py' --- lava_dispatcher/actions/launch_control.py 2011-10-13 09:28:22 +0000 +++ lava_dispatcher/actions/launch_control.py 2011-10-18 02:38:34 +0000 @@ -108,6 +108,7 @@ try: self.in_master_shell() except: + logging.exception("in_master_shell failed") client.boot_master_image() client.run_cmd_master('mkdir -p /mnt/root') @@ -156,6 +157,8 @@ except: if time.time() >= now + timeout: raise + else: + logging.exception("download failed, retrying") except: logging.warning(traceback.format_exc()) status = 'fail' === modified file 'lava_dispatcher/actions/lava-test.py' --- lava_dispatcher/actions/lava-test.py 2011-10-04 04:18:22 +0000 +++ lava_dispatcher/actions/lava-test.py 2011-10-18 02:38:34 +0000 @@ -34,6 +34,7 @@ try: client.in_master_shell() except: + logging.exception("in_master_shell failed") client.boot_master_image() client.run_cmd_master('mkdir -p /mnt/root') @@ -99,10 +100,12 @@ try: rc = client.run_cmd_tester(cmd, timeout=timeout) except: + logging.exception("run_cmd_tester failed") client.proc.sendcontrol('c') try: client.run_cmd_tester('true', timeout=20) except: + logging.exception("run_cmd_tester true failed, rebooting") client.boot_linaro_image() raise if rc is None: === modified file 'lava_dispatcher/android_client.py' --- lava_dispatcher/android_client.py 2011-10-10 10:19:45 +0000 +++ lava_dispatcher/android_client.py 2011-10-18 02:38:34 +0000 @@ -61,6 +61,7 @@ try: self.enter_uboot() except: + logging.exception('enter_uboot failed') self.hard_reboot() self.enter_uboot() boot_cmds = string_to_list(self.config.get('boot_cmds_android')) @@ -133,6 +134,7 @@ try: ip = self._get_default_nic_ip_by_ifconfig(network_interface) except: + logging.exception("_get_default_nic_ip_by_ifconfig failed") pass if ip is None: @@ -162,6 +164,7 @@ try: self.run_cmd_tester('netcfg %s dhcp' % nic, timeout=60) except: + logging.exception("netcfg %s dhcp failed" % nic) raise NetworkError("netcfg %s dhcp exception" % nic) === modified file 'lava_dispatcher/client.py' --- lava_dispatcher/client.py 2011-10-14 19:28:59 +0000 +++ lava_dispatcher/client.py 2011-10-18 02:38:34 +0000 @@ -99,11 +99,9 @@ self.proc.expect("Starting kernel") self.in_master_shell() except: + logging.exception("in_master_shell failed") self.hard_reboot() - try: - self.in_master_shell() - except: - raise + self.in_master_shell() self.proc.sendline('export PS1="$PS1 [rc=$(echo \$?)]: "') self.proc.expect(self.master_str) @@ -114,6 +112,7 @@ try: self.enter_uboot() except: + logging.exception("enter_uboot failed") self.hard_reboot() self.enter_uboot() boot_cmds = self.boot_cmds === modified file 'lava_dispatcher/utils.py' --- lava_dispatcher/utils.py 2011-09-19 06:15:01 +0000 +++ lava_dispatcher/utils.py 2011-10-18 02:38:34 +0000 @@ -18,6 +18,7 @@ # along # with this program; if not, see . +import logging import os import shutil import urllib2 @@ -37,6 +38,7 @@ fd.close() response.close() except: + logging.exception("download failed") raise RuntimeError("Could not retrieve %s" % url) return filename