diff options
author | Eoghan Glynn <eglynn@redhat.com> | 2014-03-27 10:28:08 +0000 |
---|---|---|
committer | Eoghan Glynn <eglynn@redhat.com> | 2014-04-01 10:46:54 +0100 |
commit | defbb95855443047c3fb0a90ca4a9c9d1a51180b (patch) | |
tree | d4ff20d406ce5acff1b22ee99fbc48670084d940 /ceilometerclient/v2/statistics.py | |
parent | fcfffacd3b13ca295a7f2ba42176f4212c1c96fb (diff) | |
download | python-ceilometerclient-1.0.10.tar.gz |
Ensure statistics aggregates are ordered with parameterized first1.0.10
Fixes bug 1298528
Due to WSME re-ordering of query parameters, in the mixed case
any parameterized aggregates must be specified in the URL first,
prior to any unparameterized aggregates.
Otherwise the aggregate parameter will be associated with the
wrong aggregate function.
Change-Id: Ib2c76d03a4fc91d13074a03caade2c776d2309b3
Diffstat (limited to 'ceilometerclient/v2/statistics.py')
-rw-r--r-- | ceilometerclient/v2/statistics.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/ceilometerclient/v2/statistics.py b/ceilometerclient/v2/statistics.py index 689992c..d0b56c9 100644 --- a/ceilometerclient/v2/statistics.py +++ b/ceilometerclient/v2/statistics.py @@ -26,13 +26,19 @@ class StatisticsManager(base.Manager): def _build_aggregates(self, aggregates): url_aggregates = [] for aggregate in aggregates: - url_aggregates.append( - "aggregate.func=%(func)s" % aggregate - ) if 'param' in aggregate: - url_aggregates.append( + url_aggregates.insert( + 0, "aggregate.param=%(param)s" % aggregate ) + url_aggregates.insert( + 0, + "aggregate.func=%(func)s" % aggregate + ) + else: + url_aggregates.append( + "aggregate.func=%(func)s" % aggregate + ) return url_aggregates def list(self, meter_name, q=None, period=None, groupby=[], aggregates=[]): |