PlacementAPIClient.update_resource_class client call missing argument

"PlacementAPIClient.update_resource_class" is calling Placement client
"put" method with a missing argument, "data". In this call, "data"
should be None [1], but it's a positional argument and must be passed.

[1] https://github.com/openstack/nova/blob/master/nova/api/openstack/placement/microversion.py#L41

Change-Id: Iedcad7c81a913923506bed2762b60b094f2d601d
Closes-Bug: #1794545
This commit is contained in:
Rodolfo Alonso Hernandez 2018-09-26 16:11:55 +01:00
parent f7fad5fe7b
commit 691cd287ba
2 changed files with 2 additions and 2 deletions

View File

@ -561,7 +561,7 @@ class PlacementAPIClient(object):
:param name: the name of the resource class to be updated or validated
"""
url = '/resource_classes/%s' % name
self._put(url)
self._put(url, None)
@_check_placement_api_available
def delete_resource_class(self, name):

View File

@ -424,7 +424,7 @@ class TestPlacementAPIClient(base.BaseTestCase):
def test_update_resource_class(self):
self.placement_api_client.update_resource_class(RESOURCE_CLASS_NAME)
self.placement_fixture.mock_put.assert_called_once_with(
'/resource_classes/%s' % RESOURCE_CLASS_NAME)
'/resource_classes/%s' % RESOURCE_CLASS_NAME, None)
def test_delete_resource_class(self):
self.placement_api_client.delete_resource_class(RESOURCE_CLASS_NAME)