Skip to content

Commit 5e970b1

Browse files
caberoscaberos
authored andcommitted
fix tox tool
1 parent 7757f66 commit 5e970b1

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

SoftLayer/CLI/file/detail.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99
from 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

0 commit comments

Comments
 (0)