From patchwork Tue Oct 9 02:24:12 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: 12056 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 806A923EF8 for ; Tue, 9 Oct 2012 02:24:16 +0000 (UTC) Received: from mail-pb0-f52.google.com (mail-pb0-f52.google.com [209.85.160.52]) by fiordland.canonical.com (Postfix) with ESMTP id CED62A197EE for ; Tue, 9 Oct 2012 02:24:15 +0000 (UTC) Received: by mail-pb0-f52.google.com with SMTP id rr13so5170835pbb.11 for ; Mon, 08 Oct 2012 19:24:15 -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=ADic+ZQZ9UltPAKm7kuyeMzDADMSb86q6977q06Nw9k=; b=UnL7nypckbIf9EM9pS7Lqjt4Xy6VBgFRK52BeRzzqE4IdClo+bEor28TNFAvMLTb+q +NUhNLyBCLdpCEaJ+FSZPpoFkBGMt3WH9OdUiMFR7DdkgdMV12GfKwKDqfhvywfsakIo IfjNfxS84bD4j2kJX+Rgaf0jHfHdBKOjsDq5NyrjcfWPFvNMgrKfKTieLd8FuqIlJzeX /M81TMeJ4NDe4MZ/itzweG/YuvLYBiKOgG3AnLite2PoZ+11+m93ZTr6+EJOxaOyXurv vLMp6oF20HwsD+xTkB8iL3GW0HDX00L9/VsgqejETOIktFas9mu4GeFtX2QnY0BaPkXH v/Dw== Received: by 10.68.136.229 with SMTP id qd5mr58650576pbb.154.1349749455050; Mon, 08 Oct 2012 19:24:15 -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.68.34.137 with SMTP id z9csp362428pbi; Mon, 8 Oct 2012 19:24:14 -0700 (PDT) Received: by 10.180.8.41 with SMTP id o9mr951789wia.3.1349749452918; Mon, 08 Oct 2012 19:24:12 -0700 (PDT) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id l64si13640758wep.55.2012.10.08.19.24.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 08 Oct 2012 19:24:12 -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 1TLPUS-0002dS-6C for ; Tue, 09 Oct 2012 02:24:12 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id 20953E01CE for ; Tue, 9 Oct 2012 02:24: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: 397 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-dispatcher/trunk] Rev 397: fix MasterImageTarget.file_system to propagate deletes from host to target Message-Id: <20121009022412.25860.78300.launchpad@ackee.canonical.com> Date: Tue, 09 Oct 2012 02:24: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="16112"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 3203352e26dcbde8880c0538fae35da83543b3e1 X-Gm-Message-State: ALoCoQldzD7behoi7LLtcsqyNuN3OInoxq4tZlXawTzgHylxokEn1Dtn1ujLEYLx91reNgUtvhCA Merge authors: Michael Hudson-Doyle (mwhudson) Related merge proposals: https://code.launchpad.net/~mwhudson/lava-dispatcher/MasterImageTarget.file_system-propgagates-deletes/+merge/128599 proposed by: Michael Hudson-Doyle (mwhudson) ------------------------------------------------------------ revno: 397 [merge] committer: Michael Hudson-Doyle branch nick: trunk timestamp: Tue 2012-10-09 15:23:06 +1300 message: fix MasterImageTarget.file_system to propagate deletes from host to target 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-02 02:53:01 +0000 +++ lava_dispatcher/device/master.py 2012-10-09 02:05:17 +0000 @@ -223,6 +223,8 @@ raise RuntimeError( 'unknown master image partition(%d)' % partition) + assert directory != '/', "cannot mount entire partition" + with self._as_master() as runner: if partition == self.config.data_part_android_org: lbl = _android_data_label(runner) @@ -234,7 +236,9 @@ if not runner.is_file_exist(targetdir): runner.run('mkdir %s' % targetdir) - runner.run('tar -czf /tmp/fs.tgz -C %s ./' % targetdir) + parent_dir, target_name = os.path.split(targetdir) + + runner.run('tar -czf /tmp/fs.tgz -C %s %s' % (parent_dir, target_name)) runner.run('cd /tmp') # need to be in same dir as fs.tgz self.proc.sendline('python -m SimpleHTTPServer 0 2>/dev/null') match_id = self.proc.expect([ @@ -254,7 +258,7 @@ try: os.mkdir(tfdir) logging_system('tar -C %s -xzf %s' % (tfdir, tf)) - yield tfdir + yield os.path.join(tfdir, target_name) finally: tf = os.path.join(self.scratch_dir, 'fs') @@ -266,7 +270,8 @@ # get the last 2 parts of tf, ie "scratchdir/tf.tgz" tf = '/'.join(tf.split('/')[-2:]) url = '%s/%s' % (self.context.config.lava_image_url, tf) - self.target_extract(runner, url, targetdir) + runner.run('rm -rf %s' % targetdir) + self.target_extract(runner, url, parent_dir) finally: self.proc.sendcontrol('c') # kill SimpleHTTPServer