Skip to content

Commit 7927049

Browse files
Merge pull request #1443 from FernandoOjeda/ft/vs_detail_prices
Refactor slcli hw detail prices.
2 parents 26a7e66 + a51e9cf commit 7927049

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

SoftLayer/CLI/hardware/detail.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,11 +78,13 @@ def cli(env, identifier, passwords, price):
7878
if price:
7979
total_price = utils.lookup(result, 'billingItem', 'nextInvoiceTotalRecurringAmount') or 0
8080

81-
price_table = formatting.Table(['Item', 'Recurring Price'])
82-
price_table.add_row(['Total', total_price])
81+
price_table = formatting.Table(['Item', 'CategoryCode', 'Recurring Price'])
82+
price_table.align['Item'] = 'l'
8383

84-
for item in utils.lookup(result, 'billingItem', 'children') or []:
85-
price_table.add_row([item['description'], item['nextInvoiceTotalRecurringAmount']])
84+
price_table.add_row(['Total', '-', total_price])
85+
86+
for item in utils.lookup(result, 'billingItem', 'nextInvoiceChildren') or []:
87+
price_table.add_row([item['description'], item['categoryCode'], item['nextInvoiceTotalRecurringAmount']])
8688

8789
table.add_row(['prices', price_table])
8890

SoftLayer/managers/hardware.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ def get_hardware(self, hardware_id, **kwargs):
260260
passwords[username,password]],'''
261261
'billingItem['
262262
'id,nextInvoiceTotalRecurringAmount,'
263-
'children[nextInvoiceTotalRecurringAmount],'
263+
'nextInvoiceChildren[nextInvoiceTotalRecurringAmount],'
264264
'orderItem.order.userRecord[username]'
265265
'],'
266266
'hourlyBillingFlag,'

0 commit comments

Comments
 (0)