From patchwork Wed Feb 2 13:26:31 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Lo=C3=AFc_Minier?= X-Patchwork-Id: 61 Return-Path: Delivered-To: unknown Received: from imap.gmail.com (74.125.159.109) by localhost6.localdomain6 with IMAP4-SSL; 08 Jun 2011 14:39:37 -0000 Delivered-To: patches@linaro.org Received: by 10.147.124.5 with SMTP id b5cs13506yan; Wed, 2 Feb 2011 05:26:39 -0800 (PST) Received: by 10.227.196.78 with SMTP id ef14mr9031152wbb.165.1296653198378; Wed, 02 Feb 2011 05:26:38 -0800 (PST) Received: from adelie.canonical.com (adelie.canonical.com [91.189.90.139]) by mx.google.com with ESMTP id e5si31559913wbi.91.2011.02.02.05.26.37; Wed, 02 Feb 2011 05:26:38 -0800 (PST) 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 1PkcjE-0007P2-IX for ; Wed, 02 Feb 2011 13:26:36 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 385AA2E816D for ; Wed, 2 Feb 2011 13:26:31 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: linaro-image-tools X-Launchpad-Branch: ~linaro-maintainers/linaro-image-tools/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 283 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-maintainers/linaro-image-tools/trunk] Rev 283: Merge lp:~lool/linaro-image-tools/lp-711573; fixes various issues introduced Message-Id: <20110202132631.8494.39803.launchpad@loganberry.canonical.com> Date: Wed, 02 Feb 2011 13:26:31 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="12274"; Instance="initZopeless config overlay" X-Launchpad-Hash: 316f6eed6f15265536e872fb7df361a6d26396d0 Merge authors: Loïc Minier (lool) Related merge proposals: https://code.launchpad.net/~lool/linaro-image-tools/lp-711573/+merge/48289 proposed by: Loïc Minier (lool) review: Approve - Guilherme Salgado (salgado) ------------------------------------------------------------ revno: 283 [merge] committer: Loïc Minier branch nick: linaro-image-tools timestamp: Wed 2011-02-02 14:23:49 +0100 message: Merge lp:~lool/linaro-image-tools/lp-711573; fixes various issues introduced with optional-sudo merge, notably tracebacks in cleanup. modified: linaro-media-create --- lp:linaro-image-tools https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk You are subscribed to branch lp:linaro-image-tools. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-maintainers/linaro-image-tools/trunk/+edit-subscription === modified file 'linaro-media-create' --- linaro-media-create 2011-01-29 16:46:33 +0000 +++ linaro-media-create 2011-02-02 12:08:05 +0000 @@ -63,19 +63,17 @@ """ devnull = open('/dev/null', 'w') # ignore non-zero return codes - try: - if BOOT_DISK is not None: - cmd_runner.Popen(['umount', BOOT_DISK], - stdout=devnull, stderr=devnull, as_root=True).wait() - if ROOT_DISK is not None: - cmd_runner.Popen(['umount', ROOT_DISK], - stdout=devnull, stderr=devnull, as_root=True).wait() - except SubcommandNonZeroReturnValue: - pass + for disk in BOOT_DISK, ROOT_DISK: + if disk is not None: + try: + cmd_runner.run(['umount', disk], + stdout=devnull, stderr=devnull, as_root=True).wait() + except cmd_runner.SubcommandNonZeroReturnValue: + pass # Remove TMP_DIR as root because some files written there are # owned by root. if TMP_DIR is not None: - cmd_runner.Popen(['rm', '-rf', TMP_DIR], as_root=True).wait() + cmd_runner.run(['rm', '-rf', TMP_DIR], as_root=True).wait() def ensure_required_commands(args):