diff mbox

[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
State Accepted
Headers show

Commit Message

Loïc Minier Feb. 2, 2011, 1:26 p.m. UTC
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 <lool@dooz.org>
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
diff mbox

Patch

=== 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):