From patchwork Wed Oct 31 13:38:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Pigott X-Patchwork-Id: 12630 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 BA54723FBB for ; Wed, 31 Oct 2012 13:38:17 +0000 (UTC) Received: from mail-ie0-f180.google.com (mail-ie0-f180.google.com [209.85.223.180]) by fiordland.canonical.com (Postfix) with ESMTP id 4FF98A189C8 for ; Wed, 31 Oct 2012 13:38:17 +0000 (UTC) Received: by mail-ie0-f180.google.com with SMTP id e10so1953696iej.11 for ; Wed, 31 Oct 2012 06:38:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=yz5C1IFZCiKHWgWMahNMIcNlYsBmXTAwtEQ2cQ0DV90=; b=Z46Kfp9rj/WrmvxL4pbTQr31wMTcootDwDjl5SkgKdCYAU0t29fVqRxIx703+gP+oX Zw9r63h9hta2bUDybEDUWceMCmB7J/3n34lefnuIixBSi10hnHtVpzD6t/XNceR6vWOR 7x68cUPokvNePO/aHW0Z20Pq5aaPieNNZQIhOQFc4+AMW753Z5pn3PYvSpDczrPJ2kAX wJTOrftTB83i9SRaZgj3wlbf0VEo2m0n3xFHuSrXb9LmLNsSU1vLy4u7ZcdsdueKq5Dv WYstwIv9VFClisvJnfEgho1+V6gdfSwn3yST3/bf7ozJE5YuXck5GVoBpDx5cEWF7LS5 qM/w== Received: by 10.50.47.165 with SMTP id e5mr1442382ign.57.1351690696723; Wed, 31 Oct 2012 06:38: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.50.67.148 with SMTP id n20csp623103igt; Wed, 31 Oct 2012 06:38:16 -0700 (PDT) Received: by 10.216.227.101 with SMTP id c79mr20181271weq.31.1351690695299; Wed, 31 Oct 2012 06:38:15 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id x83si2063680wei.29.2012.10.31.06.38.14 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Oct 2012 06:38:15 -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 1TTYUo-0001Lt-6V for ; Wed, 31 Oct 2012 13:38:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 1D77EE0180 for ; Wed, 31 Oct 2012 13:38:14 +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: 427 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 427: Add reboot if network doesn't come up Message-Id: <20121031133814.30547.18079.launchpad@ackee.canonical.com> Date: Wed, 31 Oct 2012 13:38:14 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="16218"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 5bd33053574c2a0edf84869c5ce9f910ef49c915 X-Gm-Message-State: ALoCoQlPCMPnQbwUV+doX6KdpMFET31bOOKTCtsY0o+Qf3QZsdVyTy8tTg5ZEghtknzEgqAjafAu ------------------------------------------------------------ revno: 427 committer: dave.pigott@linaro.org branch nick: network-retry timestamp: Wed 2012-10-31 14:24:29 +0100 message: Add reboot if network doesn't come up modified: lava_dispatcher/device/master.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/device/master.py' --- lava_dispatcher/device/master.py 2012-10-25 11:27:27 +0000 +++ lava_dispatcher/device/master.py 2012-10-31 13:24:29 +0000 @@ -454,9 +454,16 @@ def get_master_ip(self): logging.info("Waiting for network to come up") - try: - self.wait_network_up() - except: + network_up = False + attempts = 1 + while (attempts <> 0) and (not network_up): + try: + self.wait_network_up() + network_up = True + except: + target.boot_master_image() + attempts = attempts-1 + if not network_up: msg = "Unable to reach LAVA server, check network" logging.error(msg) self._client.sio.write(traceback.format_exc())