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

Commit

Permalink
Fix - disk list size (#660)
Browse files Browse the repository at this point in the history
* Fix - disk size key
  • Loading branch information
azzamsa committed May 20, 2020
1 parent 7a76e3b commit e7e853c
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit e7e853c

Please sign in to comment.