From 043b52ef22c4a23eeebd024b15a8fcfe05dbc47c Mon Sep 17 00:00:00 2001 From: azzamsa Date: Tue, 19 May 2020 16:49:27 +0700 Subject: [PATCH] Fix - disk size key --- pyvcloud/vcd/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pyvcloud/vcd/utils.py b/pyvcloud/vcd/utils.py index fa9bfc54b..0d3170d9d 100644 --- a/pyvcloud/vcd/utils.py +++ b/pyvcloud/vcd/utils.py @@ -549,8 +549,10 @@ def disk_to_dict(disk): result['name'] = disk.get('name') result['id'] = extract_id(disk.get('id')) result['status'] = disk.get('status') - result['size'] = humanfriendly.format_size(int(disk.get('size'))) - result['size_bytes'] = disk.get('size') + if 'sizeMb' in disk.keys(): + size_key = 'sizeMb' + result['size'] = humanfriendly.format_size(int(disk.get(size_key))) + result['size_bytes'] = disk.get(size_key) result['busType'] = disk.get('busType') result['busSubType'] = disk.get('busSubType') result['iops'] = disk.get('iops')