File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 99from SoftLayer import utils
1010
1111
12+ def get_capacity (file_volume ):
13+ capacity = '0'
14+ if file_volume ['capacityGb' ] != '' :
15+ capacity = "%iGB" % file_volume ['capacityGb' ]
16+ return capacity
17+
18+
1219@click .command (cls = SoftLayer .CLI .command .SLCommand , )
1320@click .argument ('volume_id' )
1421@environment .pass_env
@@ -23,14 +30,11 @@ def cli(env, volume_id):
2330 table .align ['Name' ] = 'r'
2431 table .align ['Value' ] = 'l'
2532
26- capacity = '0'
27- if file_volume ['capacityGb' ] != '' :
28- capacity = "%iGB" % file_volume ['capacityGb' ]
2933 storage_type = file_volume ['storageType' ]['keyName' ].split ('_' ).pop (0 )
3034 table .add_row (['ID' , file_volume ['id' ]])
3135 table .add_row (['Username' , file_volume ['username' ]])
3236 table .add_row (['Type' , storage_type ])
33- table .add_row (['Capacity (GB)' , capacity ])
37+ table .add_row (['Capacity (GB)' , get_capacity ( file_volume [ ' capacity' ]) ])
3438
3539 used_space = int (file_volume ['bytesUsed' ]) \
3640 if file_volume ['bytesUsed' ] else 0
You can’t perform that action at this time.
0 commit comments