Skip to content

Commit 43e2ff5

Browse files
Merge pull request #2006 from ramkishor-ch/issue_2002
Added blank value if it is empty when "Deletion Scheduled" to bandwidth pools and pool-details
2 parents 5c2793e + c90902f commit 43e2ff5

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

SoftLayer/CLI/bandwidth/pools.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ def cli(env):
3131
"Allocation",
3232
"Current Usage",
3333
"Projected Usage",
34-
"Cost"
34+
"Cost",
35+
"Deletion"
3536
], title="Bandwidth Pools")
3637
table.align = 'l'
3738
for item in items:
@@ -55,5 +56,10 @@ def cli(env):
5556
else:
5657
cost = "$0.0"
5758

58-
table.add_row([id_bandwidth, name, region, servers, allocation, current, projected, cost])
59+
deletion = utils.clean_time(item.get('endDate'))
60+
61+
if deletion == '':
62+
deletion = formatting.blank()
63+
64+
table.add_row([id_bandwidth, name, region, servers, allocation, current, projected, cost, deletion])
5965
env.fout(table)

SoftLayer/CLI/bandwidth/pools_detail.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ 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+
end_date = utils.clean_time(bandwidths.get('endDate'))
28+
if end_date == '':
29+
end_date = formatting.blank()
30+
table.add_row(['End Date', end_date])
31+
else:
32+
table.add_row(['End Date', utils.clean_time(bandwidths.get('endDate'))])
2733
current = f"{utils.lookup(bandwidths, 'billingCyclePublicBandwidthUsage', 'amountOut')} GB"
2834
if current is None:
2935
current = '-'

SoftLayer/fixtures/SoftLayer_Account.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,6 +1420,7 @@
14201420
'amountIn': '6.94517',
14211421
'amountOut': '6.8859'
14221422
},
1423+
"endDate": "2023-07-03T22:59:59-06:00",
14231424
'id': 309961,
14241425
'locationGroup': {
14251426
'description': 'All Datacenters in Mexico',

SoftLayer/managers/account.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def get_bandwidth_pools(self, mask=None):
374374
if mask is None:
375375
mask = """mask[totalBandwidthAllocated,locationGroup, id, name, projectedPublicBandwidthUsage,
376376
billingCyclePublicBandwidthUsage[amountOut,amountIn],
377-
billingItem[id,nextInvoiceTotalRecurringAmount],outboundPublicBandwidthUsage,serviceProviderId,bandwidthAllotmentTypeId,activeDetailCount]
377+
billingItem[id,nextInvoiceTotalRecurringAmount],outboundPublicBandwidthUsage,serviceProviderId,bandwidthAllotmentTypeId,activeDetailCount,endDate]
378378
"""
379379

380380
return self.client.call('SoftLayer_Account', 'getBandwidthAllotments', mask=mask, iter=True)

0 commit comments

Comments
 (0)