Skip to content

Commit 7f410f6

Browse files
author
caberos
committed
fix Christopher code review comments
1 parent 9302f97 commit 7f410f6

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

SoftLayer/CLI/account/orders.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ def cli(env, limit):
2020
manager = AccountManager(env.client)
2121
orders = manager.get_account_all_billing_orders(limit)
2222

23-
table = []
24-
order_table = formatting.Table(['id', 'State', 'user', 'PurchaseDate', 'orderTotalAmount', 'Items'],
23+
order_table = formatting.Table(['Id', 'State', 'User', 'Date', 'Amount', 'Item'],
2524
title="orders")
26-
order_table.sortby = 'orderTotalAmount'
25+
order_table.sortby = 'Amount'
2726
order_table.align = 'l'
2827

2928
for order in orders:
@@ -34,5 +33,4 @@ def cli(env, limit):
3433

3534
order_table.add_row([order['id'], order['status'], order['userRecord']['username'], create_date,
3635
order['orderTotalAmount'], utils.trim_to(' '.join(map(str, items)), 50)])
37-
table.append(order_table)
38-
env.fout(formatting.listing(table, separator='\n'))
36+
env.fout(order_table)

SoftLayer/managers/account.py

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def cancel_item(self, identifier, reason="No longer needed", note=None):
234234

235235
return self.client.call('Billing_Item', 'cancelItem', False, True, reason, note, id=identifier)
236236

237-
def get_account_all_billing_orders(self, limit, mask=None):
237+
def get_account_all_billing_orders(self, limit=100, mask=None):
238238
"""Gets all the topLevelBillingItems currently active on the account
239239
240240
:param string mask: Object Mask
@@ -247,14 +247,6 @@ def get_account_all_billing_orders(self, limit, mask=None):
247247
initialInvoice[id,amount,invoiceTotalAmount],
248248
items[description]
249249
"""
250-
object_filter = {
251-
'createDate': {
252-
'operation': 'orderBy',
253-
'options': [{
254-
'name': 'sort',
255-
'value': ['DESC']
256-
}]}
257-
}
258-
250+
print(limit)
259251
return self.client.call('Billing_Order', 'getAllObjects',
260-
limit=limit, mask=mask, filter=object_filter)
252+
limit=limit, mask=mask)

0 commit comments

Comments
 (0)