diff --git a/ceilometer/api/controllers/v2/query.py b/ceilometer/api/controllers/v2/query.py index c9348072..3826294f 100644 --- a/ceilometer/api/controllers/v2/query.py +++ b/ceilometer/api/controllers/v2/query.py @@ -216,7 +216,7 @@ class ValidatedComplexQuery(object): self._validate_orderby(self.orderby) except (ValueError, jsonschema.exceptions.ValidationError) as e: raise base.ClientSideError( - _("Order-by expression not valid: %s") % e.message) + _("Order-by expression not valid: %s") % e) self._convert_orderby_to_lower_case(self.orderby) self._normalize_field_names_in_orderby(self.orderby) diff --git a/ceilometer/tests/api/v2/test_complex_query_scenarios.py b/ceilometer/tests/api/v2/test_complex_query_scenarios.py index 809167f1..f2a048a6 100644 --- a/ceilometer/tests/api/v2/test_complex_query_scenarios.py +++ b/ceilometer/tests/api/v2/test_complex_query_scenarios.py @@ -293,7 +293,7 @@ class TestQueryMetersController(tests_api.FunctionalTest, self.assertEqual(2, len(data.json)) for sample_item in data.json: - self.assertTrue(sample_item["metadata"]["util"] >= 0.5) + self.assertTrue(float(sample_item["metadata"]["util"]) >= 0.5) def test_filter_with_negation(self): filter_expr = '{"not": {">=": {"metadata.util": 0.5}}}' diff --git a/tox.ini b/tox.ini index 8097260e..4b5c4767 100644 --- a/tox.ini +++ b/tox.ini @@ -50,6 +50,7 @@ commands = python -m testtools.run \ ceilometer.tests.api.v2.test_alarm_scenarios.TestAlarms.test_alarms_query_with_timestamp \ ceilometer.tests.api.v2.test_alarm_scenarios.TestAlarms.test_get_alarm_history_constrained_by_alarm_id_failed \ ceilometer.tests.api.v2.test_app \ + ceilometer.tests.api.v2.test_complex_query_scenarios.TestQueryMetersController.test_query_with_volume_field_name_orderby \ ceilometer.tests.api.v2.test_complex_query_scenarios.TestQueryMetersController.test_query_with_isotime \ ceilometer.tests.api.v2.test_event_scenarios.TestEventAPI.test_get_events_filter_datetime_trait \ ceilometer.tests.api.v2.test_list_meters_scenarios.TestListMeters.test_query_samples_with_invalid_field_name_and_eq_operator \