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:36 +0000 |
commit | 5fa7768bfb4b6d464c6a812822b0665f52e7bea4 (patch) | |
tree | 3b8e004abd3a91f458856e0385d8379e8b129a48 /scripts/lib/wic/partition.py | |
parent | 835f7a5c4c51f3d0d31d0193258b50596ceacb5a (diff) | |
download | openembedded-core-contrib-5fa7768bfb4b6d464c6a812822b0665f52e7bea4.tar.gz |
wic: code cleanup
Fixed indentation, unused imports, trailing lines etc.
[YOCTO #10619]
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
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(): # 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) - |