Fix human readable when size is None
If an image size is null don't stack trace when listing. Change-Id: Iba18470edbe032d1d01380372d57fa17adef5f7e Closes-bug: 1495632
This commit is contained in:
@@ -306,8 +306,10 @@ def save_image(data, path):
|
||||
def make_size_human_readable(size):
|
||||
suffix = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB']
|
||||
base = 1024.0
|
||||
|
||||
index = 0
|
||||
|
||||
if size is None:
|
||||
size = 0
|
||||
while size >= base:
|
||||
index = index + 1
|
||||
size = size / base
|
||||
|
||||
Reference in New Issue
Block a user