diff --git a/cloudkitty/storage/v2/elasticsearch/client.py b/cloudkitty/storage/v2/elasticsearch/client.py index 7716f039..525f8655 100644 --- a/cloudkitty/storage/v2/elasticsearch/client.py +++ b/cloudkitty/storage/v2/elasticsearch/client.py @@ -366,6 +366,8 @@ class ElasticsearchClient(object): if not paginate: offset = 0 + metric_types = [metric_types] if metric_types else None + must = self._build_must(begin, end, metric_types, filters) should = self._build_should(filters) composite = self._build_composite(groupby) if groupby else None diff --git a/cloudkitty/storage/v2/opensearch/client.py b/cloudkitty/storage/v2/opensearch/client.py index d5757c9b..6242019f 100644 --- a/cloudkitty/storage/v2/opensearch/client.py +++ b/cloudkitty/storage/v2/opensearch/client.py @@ -363,6 +363,8 @@ class OpenSearchClient(object): if not paginate: offset = 0 + metric_types = [metric_types] if metric_types else None + must = self._build_must(begin, end, metric_types, filters) should = self._build_should(filters) composite = self._build_composite(groupby) if groupby else None diff --git a/releasenotes/notes/fix-v1-summary-and-total-with-es-os-backend-9540741b80819672.yaml b/releasenotes/notes/fix-v1-summary-and-total-with-es-os-backend-9540741b80819672.yaml new file mode 100644 index 00000000..24623b82 --- /dev/null +++ b/releasenotes/notes/fix-v1-summary-and-total-with-es-os-backend-9540741b80819672.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixed a bug where ``openstack rating summary get -s `` and + ``openstack rating total get -s `` would fail when using the + Elasticsearch or OpenSearch storage backends. See story 2011128 + `_ for more details.