diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2016-05-04 16:06:16 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-14 07:26:42 +0100 |
commit | 003df7dfb932c551953fbf1bd769b3c31bd16fb4 (patch) | |
tree | a508854a79bc7d7a741047e51cd8a7c27c5ea4fe /scripts/lib/wic/utils | |
parent | 5b14eb8d68aaca82de4f8f6bcb28ad6f4a5125d0 (diff) | |
download | openembedded-core-003df7dfb932c551953fbf1bd769b3c31bd16fb4.tar.gz openembedded-core-003df7dfb932c551953fbf1bd769b3c31bd16fb4.tar.bz2 openembedded-core-003df7dfb932c551953fbf1bd769b3c31bd16fb4.zip |
wic: don't use dict.keys and dict.has_key
Replaced calls of dict.keys and dict.has_key methods with the
'key in dict' statement. 'key in dict' is more pythonic, faster
and readable. dict.has_key doesn't exist in Python 3.
[YOCTO #9412]
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/partitionedfs.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/lib/wic/utils/partitionedfs.py b/scripts/lib/wic/utils/partitionedfs.py index 534635b2ac..89a7c13758 100644 --- a/scripts/lib/wic/utils/partitionedfs.py +++ b/scripts/lib/wic/utils/partitionedfs.py @@ -132,7 +132,7 @@ class Image(object): for num in range(len(self.partitions)): part = self.partitions[num] - if not self.disks.has_key(part['disk_name']): + if part['disk_name'] not in self.disks: raise ImageError("No disk %s for partition %s" \ % (part['disk_name'], part['mountpoint'])) @@ -236,7 +236,7 @@ class Image(object): def __format_disks(self): self.layout_partitions() - for dev in self.disks.keys(): + for dev in self.disks: disk = self.disks[dev] msger.debug("Initializing partition table for %s" % \ (disk['disk'].device)) @@ -354,7 +354,7 @@ class Image(object): os.rename(source, image_file + '.p%d' % part['num']) def create(self): - for dev in self.disks.keys(): + for dev in self.disks: disk = self.disks[dev] disk['disk'].create() |