diff --git a/neutron_lib/clients/placement.py b/neutron_lib/clients/placement.py index 8c677e8cc..ceee392cf 100644 --- a/neutron_lib/clients/placement.py +++ b/neutron_lib/clients/placement.py @@ -130,9 +130,10 @@ class PlacementAPIClient(object): :param resource_provider: The resource provider. A dict with the name (required) and the uuid (required). + :returns: The resource provider created. """ url = '/resource_providers' - self._post(url, resource_provider) + return self._post(url, resource_provider).json() @_check_placement_api_available def delete_resource_provider(self, resource_provider_uuid): @@ -353,9 +354,10 @@ class PlacementAPIClient(object): :param resource_provider_uuid: UUID of the resource provider. :param aggregates: aggregates to be associated to the resource provider. + :returns: All aggregates associated with the resource provider. """ url = '/resource_providers/%s/aggregates' % resource_provider_uuid - self._put(url, aggregates) + return self._put(url, aggregates).json() @_check_placement_api_available def list_aggregates(self, resource_provider_uuid): diff --git a/releasenotes/notes/placement-client-return-f4f22d244e7b174a.yaml b/releasenotes/notes/placement-client-return-f4f22d244e7b174a.yaml new file mode 100644 index 000000000..0dfcf2517 --- /dev/null +++ b/releasenotes/notes/placement-client-return-f4f22d244e7b174a.yaml @@ -0,0 +1,8 @@ +--- +other: + - | + The ``create_resource_provider`` and ``associate_aggregates`` + methods of ``PlacementAPIClient`` now return the parsed + body of the respective responses. Since these methods returned ``None`` + previously this is unlikely to break anything. On the other hand callers + of these methods now have a chance to simplify their code.