From 653aaea3ccd4b671a6753bc9aecceb08f9eb0e41 Mon Sep 17 00:00:00 2001 From: Ed Bartosh Date: Tue, 31 Jan 2017 19:31:55 +0200 Subject: wic: code cleanup Fixed indentation, unused imports, trailing lines etc. [YOCTO #10619] (From OE-Core rev: 5fa7768bfb4b6d464c6a812822b0665f52e7bea4) Signed-off-by: Ed Bartosh Signed-off-by: Richard Purdie --- scripts/lib/wic/partition.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'scripts/lib/wic/partition.py') 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(): # further processing required Partition.size to be an integer, make # sure that it is one - if type(self.size) is not int: + if not isinstance(self.size, int): msger.error("Partition %s internal size is not an integer. " \ "This a bug in source plugin %s and needs to be fixed." \ % (self.mountpoint, self.source)) @@ -242,7 +242,10 @@ class Partition(): # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE rsize_bb = get_bitbake_var('ROOTFS_SIZE') if rsize_bb: - 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') + 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') self.size = int(round(float(rsize_bb))) for prefix in ("ext", "btrfs", "vfat", "squashfs"): @@ -402,7 +405,8 @@ class Partition(): "Proceeding as requested." % self.mountpoint) path = "%s/fs_%s.%s" % (cr_workdir, self.label, self.fstype) - os.path.isfile(path) and os.remove(path) + if os.path.isfile(path): + os.remove(path) # it is not possible to create a squashfs without source data, # thus prepare an empty temp dir that is used as source @@ -436,4 +440,3 @@ class Partition(): label_str = "-L %s" % self.label mkswap_cmd = "mkswap %s -U %s %s" % (label_str, str(uuid.uuid1()), path) exec_native_cmd(mkswap_cmd, native_sysroot) - -- cgit v1.2.3-54-g00ecf