diff options
author | Steve Baker <sbaker@redhat.com> | 2015-02-10 16:59:02 +1300 |
---|---|---|
committer | Steve Baker <sbaker@redhat.com> | 2015-02-10 16:59:02 +1300 |
commit | 9b28902c5f949b29934aae7402fdb78e7088d7fe (patch) | |
tree | b7bf6696fd0de77f8b2a24462b4b8aed2c7de49d | |
parent | a47351cc834c81cc3b8668da3f86ec6739b34b9a (diff) | |
download | python-heatclient-9b28902c5f949b29934aae7402fdb78e7088d7fe.tar.gz |
Sort event-list by oldest first
Since event-list is log-like, it would be *much* friendlier
to users to sort by oldest first, especially for large
stacks where the events scroll.
This change adds sort_dir=asc to the event list query for
the CLI event-list command only.
Change-Id: I479e9ec36bf14a5f250348ca4279c508da23c2a2
Closes-Bug: #1420091
-rw-r--r-- | heatclient/tests/test_shell.py | 2 | ||||
-rw-r--r-- | heatclient/v1/shell.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/heatclient/tests/test_shell.py b/heatclient/tests/test_shell.py index 8672939..c2d0495 100644 --- a/heatclient/tests/test_shell.py +++ b/heatclient/tests/test_shell.py @@ -1954,7 +1954,7 @@ class ShellTestEvents(ShellBase): stack_id = 'teststack/1' resource_name = 'testresource/1' http.HTTPClient.json_request( - 'GET', '/stacks/%s/resources/%s/events' % ( + 'GET', '/stacks/%s/resources/%s/events?sort_dir=asc' % ( parse.quote(stack_id, ''), parse.quote(encodeutils.safe_encode( resource_name), ''))).AndReturn((resp, resp_dict)) diff --git a/heatclient/v1/shell.py b/heatclient/v1/shell.py index 6d7729a..78b5486 100644 --- a/heatclient/v1/shell.py +++ b/heatclient/v1/shell.py @@ -903,7 +903,8 @@ def do_event_list(hc, args): 'resource_name': args.resource, 'limit': args.limit, 'marker': args.marker, - 'filters': utils.format_parameters(args.filters)} + 'filters': utils.format_parameters(args.filters), + 'sort_dir': 'asc'} try: events = hc.events.list(**fields) except exc.HTTPNotFound as ex: |