Skip to content

Commit 2dea41b

Browse files
caberoscaberos
authored andcommitted
Issues with block/file volume-details on some volumes
1 parent 182f7b3 commit 2dea41b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

SoftLayer/CLI/block/detail.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@ def cli(env, volume_id):
2323
table.align['Name'] = 'r'
2424
table.align['Value'] = 'l'
2525

26+
capacity = '0'
27+
if block_volume['capacityGb'] != '':
28+
capacity = "%iGB" % block_volume['capacityGb']
2629
storage_type = block_volume['storageType']['keyName'].split('_').pop(0)
2730
table.add_row(['ID', block_volume['id']])
2831
table.add_row(['Username', block_volume['username']])
2932
table.add_row(['Type', storage_type])
30-
table.add_row(['Capacity (GB)', "%iGB" % block_volume['capacityGb']])
33+
table.add_row(['Capacity (GB)', capacity])
3134
table.add_row(['LUN Id', "%s" % block_volume['lunId']])
3235

3336
if block_volume.get('provisionedIops'):

SoftLayer/CLI/file/detail.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,14 @@ def cli(env, volume_id):
2222
table = formatting.KeyValueTable(['Name', 'Value'])
2323
table.align['Name'] = 'r'
2424
table.align['Value'] = 'l'
25-
25+
capacity = '0'
26+
if file_volume['capacityGb'] != '':
27+
capacity = "%iGB" % file_volume['capacityGb']
2628
storage_type = file_volume['storageType']['keyName'].split('_').pop(0)
2729
table.add_row(['ID', file_volume['id']])
2830
table.add_row(['Username', file_volume['username']])
2931
table.add_row(['Type', storage_type])
30-
table.add_row(['Capacity (GB)', "%iGB" % file_volume['capacityGb']])
32+
table.add_row(['Capacity (GB)', capacity])
3133

3234
used_space = int(file_volume['bytesUsed']) \
3335
if file_volume['bytesUsed'] else 0

0 commit comments

Comments
 (0)