@@ -24,15 +24,15 @@ def cli(env, identifier):
2424 table .add_row (['Id' , bandwidths ['id' ]])
2525 table .add_row (['Name' , bandwidths ['name' ]])
2626 table .add_row (['Create Date' , utils .clean_time (bandwidths .get ('createDate' ), '%Y-%m-%d' )])
27- current = "{} GB" . format ( utils .lookup (bandwidths , 'billingCyclePublicBandwidthUsage' , 'amountOut' ))
27+ current = f" { utils .lookup (bandwidths , 'billingCyclePublicBandwidthUsage' , 'amountOut' )} GB"
2828 if current is None :
2929 current = '-'
3030 table .add_row (['Current Usage' , current ])
31- projected = "{} GB" . format ( bandwidths .get ('projectedPublicBandwidthUsage' , 0 ))
31+ projected = f" { bandwidths .get ('projectedPublicBandwidthUsage' , 0 )} GB"
3232 if projected is None :
3333 projected = '-'
3434 table .add_row (['Projected Usage' , projected ])
35- inbound = "{} GB" . format ( bandwidths .get ('inboundPublicBandwidthUsage' , 0 ))
35+ inbound = f" { bandwidths .get ('inboundPublicBandwidthUsage' , 0 )} GB"
3636 if inbound is None :
3737 inbound = '-'
3838 table .add_row (['Inbound Usage' , inbound ])
@@ -58,8 +58,8 @@ def _bw_table(bw_data):
5858 """Generates a bandwidth useage table"""
5959 table_data = formatting .Table (['Id' , 'HostName' , "IP Address" , 'Amount' , "Current Usage" ])
6060 for bw_point in bw_data :
61- amount = "{} GB" . format ( utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amount' ))
62- current = "{} GB" . format ( bw_point .get ('outboundBandwidthUsage' , 0 ))
61+ amount = f" { utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amount' )} GB"
62+ current = f" { bw_point .get ('outboundBandwidthUsage' , 0 )} GB"
6363 ip_address = bw_point .get ('primaryIpAddress' )
6464 if ip_address is None :
6565 ip_address = '-'
@@ -71,8 +71,8 @@ def _virtual_table(bw_data):
7171 """Generates a virtual bandwidth usage table"""
7272 table_data = formatting .Table (['Id' , 'HostName' , "IP Address" , 'Amount' , "Current Usage" ])
7373 for bw_point in bw_data :
74- amount = "{} GB" . format ( utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amount' ))
75- current = "{} GB" . format ( bw_point .get ('outboundBandwidthUsage' , 0 ))
74+ amount = f" { utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amount' )} GB"
75+ current = f" { bw_point .get ('outboundBandwidthUsage' , 0 )} GB"
7676 ip_address = bw_point .get ('primaryIpAddress' )
7777 if ip_address is None :
7878 ip_address = '-'
0 commit comments