Skip to content

Commit 60948da

Browse files
Merge pull request #1808 from caberos/issue1806
add a limit and sortby on data time on ticket list command on result …
2 parents a64f8ef + 6edcad6 commit 60948da

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

SoftLayer/CLI/ticket/list.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# :license: MIT, see LICENSE for more details.
33

44
import click
5+
from SoftLayer import utils
56

67
import SoftLayer
78
from SoftLayer.CLI import environment
@@ -30,7 +31,7 @@ def cli(env, is_open):
3031
ticket['serviceProviderResourceId'],
3132
user,
3233
click.wrap_text(ticket['title']),
33-
ticket['lastEditDate'],
34+
utils.clean_time(ticket.get('lastEditDate'), out_format="%Y-%m-%d"),
3435
ticket['status']['name'],
3536
ticket.get('updateCount', 0),
3637
ticket.get('priority', 0)

SoftLayer/managers/ticket.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def list_tickets(self, open_status=True, closed_status=True):
3939
call = 'getClosedTickets'
4040
else:
4141
raise ValueError("open_status and closed_status cannot both be False")
42-
return self.client.call('Account', call, mask=mask, iter=True)
42+
return self.client.call('Account', call, mask=mask, iter=False, limit=100)
4343

4444
def list_subjects(self):
4545
"""List all ticket subjects."""

tests/CLI/modules/ticket_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def test_list(self):
3939
'assigned_user': 'John Smith',
4040
'Case_Number': 'CS123456',
4141
'id': 102,
42-
'last_edited': '2013-08-01T14:16:47-07:00',
42+
'last_edited': '2013-08-01',
4343
'priority': 0,
4444
'status': 'Open',
4545
'title': 'Cloud Instance Cancellation - 08/01/13',

0 commit comments

Comments
 (0)