@@ -23,7 +23,7 @@ def cli(env, identifier):
2323 table .add_row (['Id' , bandwidths ['id' ]])
2424 table .add_row (['Name' , bandwidths ['name' ]])
2525 table .add_row (['Create Date' , bandwidths ['createDate' ]])
26- current = "{} GB" .format (utils .lookup (bandwidths , 'billingCyclePublicBandwidthUsage' , 'amountOut' , 0 ))
26+ current = "{} GB" .format (utils .lookup (bandwidths , 'billingCyclePublicBandwidthUsage' , 'amountOut' ))
2727 table .add_row (['Current Usage' , current ])
2828 projected = "{} GB" .format (bandwidths .get ('projectedPublicBandwidthUsage' , 0 ))
2929 table .add_row (['Projected Usage' , projected ])
@@ -51,8 +51,8 @@ def _bw_table(bw_data):
5151 """Generates a bandwidth useage table"""
5252 table_data = formatting .Table (['Id' , 'HostName' , "IP Address" , 'Amount' , "Current Usage" ])
5353 for bw_point in bw_data :
54- amount = "{} GB" .format (utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amountOut' , 0 ))
55- current = "{} GB" .format (utils . lookup ( bw_point , 'outboundBandwidthUsage' , 0 ))
54+ amount = "{} GB" .format (utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amountOut' ))
55+ current = "{} GB" .format (bw_point . get ( 'outboundBandwidthUsage' , 0 ))
5656 ip_address = bw_point ['primaryIpAddress' ]
5757 table_data .add_row ([bw_point ['id' ], bw_point ['fullyQualifiedDomainName' ], ip_address , amount , current ])
5858 return [table_data ]
@@ -62,8 +62,8 @@ def _virtual_table(bw_data):
6262 """Generates a virtual bandwidth usage table"""
6363 table_data = formatting .Table (['Id' , 'HostName' , "IP Address" , 'Amount' , "Current Usage" ])
6464 for bw_point in bw_data :
65- amount = "{} GB" .format (utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amountOut' , 0 ))
66- current = "{} GB" .format (utils . lookup ( bw_point , 'outboundBandwidthUsage' , 0 ))
65+ amount = "{} GB" .format (utils .lookup (bw_point , 'bandwidthAllotmentDetail' , 'allocation' , 'amountOut' ))
66+ current = "{} GB" .format (bw_point . get ( 'outboundBandwidthUsage' , 0 ))
6767 ip_address = bw_point ['primaryIpAddress' ]
6868 table_data .add_row ([bw_point ['id' ], bw_point ['fullyQualifiedDomainName' ], ip_address , amount , current ])
6969 return [table_data ]
0 commit comments