summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/utils
diff options
context:
space:
mode:
authorEd Bartosh <ed.bartosh@linux.intel.com>2017-01-31 19:31:55 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-02 17:37:44 +0000
commit653aaea3ccd4b671a6753bc9aecceb08f9eb0e41 (patch)
tree0eb9d944309e79eae732c76eb483533625aec22f /scripts/lib/wic/utils
parent1f7ce90af6e2e3ae23e11eae85d13f7c93b032cd (diff)
downloadpoky-653aaea3ccd4b671a6753bc9aecceb08f9eb0e41.tar.gz
wic: code cleanup
Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] (From OE-Core rev: 5fa7768bfb4b6d464c6a812822b0665f52e7bea4) Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/utils')
-rw-r--r--scripts/lib/wic/utils/misc.py9
-rw-r--r--scripts/lib/wic/utils/partitionedfs.py7
2 files changed, 6 insertions, 10 deletions
diff --git a/scripts/lib/wic/utils/misc.py b/scripts/lib/wic/utils/misc.py
index 6781d8381a..edb9c5b484 100644
--- a/scripts/lib/wic/utils/misc.py
+++ b/scripts/lib/wic/utils/misc.py
@@ -77,18 +77,15 @@ def _exec_cmd(cmd_and_args, as_shell=False, catch=3):
77 msger.debug("_exec_cmd: output for %s (rc = %d): %s" % \ 77 msger.debug("_exec_cmd: output for %s (rc = %d): %s" % \
78 (cmd_and_args, ret, out)) 78 (cmd_and_args, ret, out))
79 79
80 return (ret, out) 80 return ret, out
81 81
82 82
83def exec_cmd(cmd_and_args, as_shell=False, catch=3): 83def exec_cmd(cmd_and_args, as_shell=False, catch=3):
84 """ 84 """
85 Execute command, catching stderr, stdout 85 Execute command, return output
86
87 Exits if rc non-zero
88 """ 86 """
89 ret, out = _exec_cmd(cmd_and_args, as_shell, catch) 87 return _exec_cmd(cmd_and_args, as_shell, catch)[1]
90 88
91 return out
92 89
93def exec_native_cmd(cmd_and_args, native_sysroot, catch=3, pseudo=""): 90def exec_native_cmd(cmd_and_args, native_sysroot, catch=3, pseudo=""):
94 """ 91 """
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py
index eb4d7e6a51..5fc5765d65 100644
--- a/scripts/lib/wic/utils/partitionedfs.py
+++ b/scripts/lib/wic/utils/partitionedfs.py
@@ -21,7 +21,7 @@
21import os 21import os
22from wic import msger 22from wic import msger
23from wic.utils.errors import ImageError 23from wic.utils.errors import ImageError
24from wic.utils.misc import exec_cmd, exec_native_cmd 24from wic.utils.misc import exec_native_cmd
25from wic.filemap import sparse_copy 25from wic.filemap import sparse_copy
26 26
27# Overhead of the MBR partitioning scheme (just one sector) 27# Overhead of the MBR partitioning scheme (just one sector)
@@ -350,10 +350,9 @@ class Image():
350 if self.disks: 350 if self.disks:
351 for dev in self.disks: 351 for dev in self.disks:
352 disk = self.disks[dev] 352 disk = self.disks[dev]
353 try: 353 if hasattr(disk['disk'], 'cleanup'):
354 disk['disk'].cleanup() 354 disk['disk'].cleanup()
355 except: 355
356 pass
357 # remove partition images 356 # remove partition images
358 for image in self.partimages: 357 for image in self.partimages:
359 if os.path.isfile(image): 358 if os.path.isfile(image):