From 998c72bd77d63e370b9167a205993f6731dcabf3 Mon Sep 17 00:00:00 2001 From: Dina Belova Date: Wed, 18 Jun 2014 18:27:04 +0400 Subject: Fix the alarm history order shown to user In the Ceilometer storage backends implementation we are specially sorting the alarm history points in the following way: the first one by the timestamp should be the last one in the list. The Python client itself provides the information in this way, but the table printed had the opposite one, so this was fixed. Change-Id: If39bb5868e360f37ed76c12b55fc71eade331f47 --- ceilometerclient/v2/shell.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ceilometerclient/v2/shell.py b/ceilometerclient/v2/shell.py index 7c4629b..d5bddf5 100644 --- a/ceilometerclient/v2/shell.py +++ b/ceilometerclient/v2/shell.py @@ -649,9 +649,13 @@ def do_alarm_history(cc, args={}): raise exc.CommandError('Alarm not found: %s' % args.alarm_id) field_labels = ['Type', 'Timestamp', 'Detail'] fields = ['type', 'timestamp', 'detail'] + # We're using sortby=None as the alarm history returned from the Ceilometer + # is already sorted in the "the newer state is the earlier one in the + # list". If we'll pass any field as a sortby param, it'll be sorted in the + # ASC way by the PrettyTable utils.print_list(history, fields, field_labels, formatters={'detail': alarm_change_detail_formatter}, - sortby=1) + sortby=None) @utils.arg('-q', '--query', metavar='', -- cgit v1.2.1