diff options
author | Chris Dent <chdent@redhat.com> | 2014-09-10 20:58:55 +0100 |
---|---|---|
committer | Chris Dent <chdent@redhat.com> | 2014-09-10 21:02:31 +0100 |
commit | c5d7f96914c1ef0dbd490fbe7899c7633d16d070 (patch) | |
tree | 3caf428cacfcb8d81b8d1dbec38d7ee6ed008348 | |
parent | 4cef2bf39a377759e22042609abb35aaad2da2b4 (diff) | |
download | python-ceilometerclient-c5d7f96914c1ef0dbd490fbe7899c7633d16d070.tar.gz |
Fix sample-create in v2 api calls
A dict embedded in a list is the expected input. In
47934c777c50897b649793e0960eebdaad322c45 the list was lost, this
puts it back.
Note that the _exact_ date of this failure was identified by
existing Rally jobs which started failing in early August. That made
searching the commit logs straightforward.
Change-Id: I37e794de7a23b8ce8e67a086732af5a19f182409
Closes-Bug: #1367867
-rw-r--r-- | ceilometerclient/tests/v2/test_samples.py | 2 | ||||
-rw-r--r-- | ceilometerclient/v2/samples.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/ceilometerclient/tests/v2/test_samples.py b/ceilometerclient/tests/v2/test_samples.py index 5804c7e..dfbdf39 100644 --- a/ceilometerclient/tests/v2/test_samples.py +++ b/ceilometerclient/tests/v2/test_samples.py @@ -103,7 +103,7 @@ class SampleManagerTest(utils.BaseTestCase): expect = [ 'POST', '/v2/meters/instance' ] - self.http_client.assert_called(*expect, body=CREATE_SAMPLE) + self.http_client.assert_called(*expect, body=[CREATE_SAMPLE]) self.assertIsNotNone(sample) def test_limit(self): diff --git a/ceilometerclient/v2/samples.py b/ceilometerclient/v2/samples.py index b0ff3b5..8081efc 100644 --- a/ceilometerclient/v2/samples.py +++ b/ceilometerclient/v2/samples.py @@ -47,6 +47,6 @@ class SampleManager(base.Manager): new = dict((key, value) for (key, value) in kwargs.items() if key in CREATION_ATTRIBUTES) url = self._path(counter_name=kwargs['counter_name']) - body = self.api.post(url, json=new).json() + body = self.api.post(url, json=[new]).json() if body: return [Sample(self, b) for b in body] |