From patchwork Thu Sep 20 21:35:14 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: 11612 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 1C81423E57 for ; Thu, 20 Sep 2012 21:35:18 +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 AE2B4A18463 for ; Thu, 20 Sep 2012 21:35:17 +0000 (UTC) Received: by ieje10 with SMTP id e10so3673015iej.11 for ; Thu, 20 Sep 2012 14:35:17 -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=MFo2k51SMmptiMC5fJPpxsBOsNH5TIf2LpyiAwOrVFk=; b=c9Hvq+/9IIantRG0DST3cxZaK/4fQNiYl7YSdogHqlXrPSO4bnWavMTeazAaKhKqzi cByU24+GC/QDSXMzPCSOi02zlKrqSFR46UNPoDwhgvkqw1qgbQ3eF/6E28kGHu2h1xms G+EmOK0rBT4Nu5l8t6ZGXsVHMD/jLh1h7T8+qojlEMYqDhmjE3yyo0TyGNUce2ODCioS LmwUHLxIbvYGdaJfPzWmntvHXdUit2VMoVAPz3XnFl+1tfxdXjx3bT2xe9kPKqW+/OMa Qci2UwwrSIWBXkKuZGBTylwpYxCQDOE1Q9bVtkB69r1O0Ul2Lp2nutPLMKT58NaIRCOn 9BDA== Received: by 10.50.217.229 with SMTP id pb5mr2962789igc.28.1348176917010; Thu, 20 Sep 2012 14:35: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.50.184.232 with SMTP id ex8csp98797igc; Thu, 20 Sep 2012 14:35:16 -0700 (PDT) Received: by 10.217.2.133 with SMTP id p5mr1777993wes.143.1348176915196; Thu, 20 Sep 2012 14:35:15 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id l16si1107503wen.109.2012.09.20.14.35.14 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 14:35: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 1TEoOw-00084C-Ez for ; Thu, 20 Sep 2012 21:35:14 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 6745CE2237 for ; Thu, 20 Sep 2012 21:35: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: 387 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 387: do not explode if /etc/resolv.conf is missing in the testrootfs Message-Id: <20120920213514.23103.10152.launchpad@ackee.canonical.com> Date: Thu, 20 Sep 2012 21:35: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="15985"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 0d333b185875b30b3f0a6dac94b12bfdbca7bcec X-Gm-Message-State: ALoCoQl6z8PpukKKOyq+bbiv1JTxXCEjvpIihgRIMjGNxql/3ZX0jaz/eOUZtEKOLiSc1f9t2v+G Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/resolv.conf-forgiveness-bug-1052373/+merge/125398 proposed by: Michael Hudson-Doyle (mwhudson) review: Approve - Andy Doan (doanac) ------------------------------------------------------------ revno: 387 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Fri 2012-09-21 09:34:50 +1200 message: do not explode if /etc/resolv.conf is missing in the testrootfs modified: lava_dispatcher/client/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/client/master.py' --- lava_dispatcher/client/master.py 2012-09-20 21:34:24 +0000 +++ lava_dispatcher/client/master.py 2012-09-20 21:34:50 +0000 @@ -764,8 +764,8 @@ master_session.run('mount /dev/disk/by-label/%s %s' % ( partition, directory)) master_session.run( - 'cp -f %s/etc/resolv.conf %s/etc/resolv.conf.bak' % ( - directory, directory)) + '[ -e %s/etc/resolv.conf ] && cp -f %s/etc/resolv.conf %s/etc/resolv.conf.bak' % ( + directory, directory, directory)) master_session.run('cp -L /etc/resolv.conf %s/etc' % directory) #eliminate warning: Can not write log, openpty() failed # (/dev/pts not mounted?), does not work @@ -775,8 +775,8 @@ 'chroot ' + directory, self.proc, self.master_str) finally: master_session.run( - 'cp -f %s/etc/resolv.conf.bak %s/etc/resolv.conf' % ( - directory, directory)) + '[ -e %s/etc/resolv.conf.bak ] && cp -f %s/etc/resolv.conf.bak %s/etc/resolv.conf || rm %s/etc/resolv.conf' % ( + directory, directory, directory, directory)) cmd = ('cat /proc/mounts | awk \'{print $2}\' | grep "^%s/dev"' '| sort -r | xargs umount' % directory) master_session.run(cmd)