Fix sample-create in v2 api calls

A dict embedded in a list is the expected input. In
47934c777c 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
This commit is contained in:
Chris Dent 2014-09-10 20:58:55 +01:00
parent 4cef2bf39a
commit c5d7f96914
2 changed files with 2 additions and 2 deletions

View File

@ -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):

View File

@ -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]