wic: use // operator instead of /

Division operator works differently in Python 3. It results in
float unlike in Python 2, where it results in int.
Explicitly used "floor division" operator instead of 'division'
operator. This should make the code to result in integer under
both pythons.

[YOCTO #9412]

(From OE-Core rev: 997ff239bd753a7957cc14c6829b2f093d9bcef6)

Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Ed Bartosh
2016-05-04 16:06:24 +03:00
committed by Richard Purdie
parent bc89dc4225
commit 5f06463c6c
2 changed files with 10 additions and 10 deletions

View File

@@ -95,7 +95,7 @@ class Image():
ks_pnum = len(self.partitions)
# Converting kB to sectors for parted
size = size * 1024 / self.sector_size
size = size * 1024 // self.sector_size
part = {'ks_pnum': ks_pnum, # Partition number in the KS file
'size': size, # In sectors
@@ -173,12 +173,12 @@ class Image():
# gaps we could enlargea the previous partition?
# Calc how much the alignment is off.
align_sectors = disk['offset'] % (part['align'] * 1024 / self.sector_size)
align_sectors = disk['offset'] % (part['align'] * 1024 // self.sector_size)
if align_sectors:
# If partition is not aligned as required, we need
# to move forward to the next alignment point
align_sectors = (part['align'] * 1024 / self.sector_size) - align_sectors
align_sectors = (part['align'] * 1024 // self.sector_size) - align_sectors
msger.debug("Realignment for %s%s with %s sectors, original"
" offset %s, target alignment is %sK." %