diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2017-01-31 19:31:55 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-02-02 17:37:44 +0000 |
commit | 653aaea3ccd4b671a6753bc9aecceb08f9eb0e41 (patch) | |
tree | 0eb9d944309e79eae732c76eb483533625aec22f /scripts/lib/wic/partition.py | |
parent | 1f7ce90af6e2e3ae23e11eae85d13f7c93b032cd (diff) | |
download | poky-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/partition.py')
-rw-r--r-- | scripts/lib/wic/partition.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 31a03506ca..69b369ce32 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py | |||
@@ -182,7 +182,7 @@ class Partition(): | |||
182 | 182 | ||
183 | # further processing required Partition.size to be an integer, make | 183 | # further processing required Partition.size to be an integer, make |
184 | # sure that it is one | 184 | # sure that it is one |
185 | if type(self.size) is not int: | 185 | if not isinstance(self.size, int): |
186 | msger.error("Partition %s internal size is not an integer. " \ | 186 | msger.error("Partition %s internal size is not an integer. " \ |
187 | "This a bug in source plugin %s and needs to be fixed." \ | 187 | "This a bug in source plugin %s and needs to be fixed." \ |
188 | % (self.mountpoint, self.source)) | 188 | % (self.mountpoint, self.source)) |
@@ -242,7 +242,10 @@ class Partition(): | |||
242 | # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE | 242 | # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE |
243 | rsize_bb = get_bitbake_var('ROOTFS_SIZE') | 243 | rsize_bb = get_bitbake_var('ROOTFS_SIZE') |
244 | if rsize_bb: | 244 | if rsize_bb: |
245 | msger.warning('overhead-factor was specified, but size was not, so bitbake variables will be used for the size. In this case both IMAGE_OVERHEAD_FACTOR and --overhead-factor will be applied') | 245 | msger.warning('overhead-factor was specified, but size was not,' |
246 | ' so bitbake variables will be used for the size.' | ||
247 | ' In this case both IMAGE_OVERHEAD_FACTOR and ' | ||
248 | '--overhead-factor will be applied') | ||
246 | self.size = int(round(float(rsize_bb))) | 249 | self.size = int(round(float(rsize_bb))) |
247 | 250 | ||
248 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): | 251 | for prefix in ("ext", "btrfs", "vfat", "squashfs"): |
@@ -402,7 +405,8 @@ class Partition(): | |||
402 | "Proceeding as requested." % self.mountpoint) | 405 | "Proceeding as requested." % self.mountpoint) |
403 | 406 | ||
404 | path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) | 407 | path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) |
405 | os.path.isfile(path) and os.remove(path) | 408 | if os.path.isfile(path): |
409 | os.remove(path) | ||
406 | 410 | ||
407 | # it is not possible to create a squashfs without source data, | 411 | # it is not possible to create a squashfs without source data, |
408 | # thus prepare an empty temp dir that is used as source | 412 | # thus prepare an empty temp dir that is used as source |
@@ -436,4 +440,3 @@ class Partition(): | |||
436 | label_str = "-L %s" % self.label | 440 | label_str = "-L %s" % self.label |
437 | mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path) | 441 | mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path) |
438 | exec_native_cmd(mkswap_cmd, native_sysroot) | 442 | exec_native_cmd(mkswap_cmd, native_sysroot) |
439 | |||