Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Fix - disk list size #660

Merged
merged 1 commit into from
May 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions pyvcloud/vcd/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,8 +549,12 @@ 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 'size' in disk.keys():
size_in_bytes = int(disk.get('size'))
else:
size_in_bytes = int(disk.get('sizeMb')) * (1024 * 1024)
result['size'] = humanfriendly.format_size(size_in_bytes)
result['size_bytes'] = size_in_bytes
result['busType'] = disk.get('busType')
result['busSubType'] = disk.get('busSubType')
result['iops'] = disk.get('iops')
Expand Down