=== modified file 'linaro_image_tools/media_create/partitions.py'
@@ -330,6 +330,9 @@
def convert_size_to_bytes(size):
"""Convert a size string in Kbytes, Mbytes or Gbytes to bytes."""
unit = size[-1].upper()
+ # no unit? (ends with a digit)
+ if unit in '0123456789':
+ return int(size)
real_size = int(size[:-1])
if unit == 'K':
real_size = real_size * 1024
=== modified file 'linaro_image_tools/media_create/tests/test_media_create.py'
@@ -846,6 +846,9 @@
return self._create_qemu_img_with_partitions(
'16384,15746,0x0C,*\n32768,,,-')
+ def test_convert_size_no_suffix(self):
+ self.assertEqual(524288, convert_size_to_bytes('524288'))
+
def test_convert_size_in_kbytes_to_bytes(self):
self.assertEqual(512 * 1024, convert_size_to_bytes('512K'))