diff --git a/nova/api/openstack/placement/handlers/resource_provider.py b/nova/api/openstack/placement/handlers/resource_provider.py index 07206c552..19fd8fdb2 100644 --- a/nova/api/openstack/placement/handlers/resource_provider.py +++ b/nova/api/openstack/placement/handlers/resource_provider.py @@ -185,8 +185,8 @@ def create_resource_provider(req): resource_provider.create() except db_exc.DBDuplicateEntry as exc: raise webob.exc.HTTPConflict( - _('Conflicting resource provider already exists: %(error)s') % - {'error': exc}) + _('Conflicting resource provider %(name)s already exists.') % + {'name': data['name']}) except exception.ObjectActionError as exc: raise webob.exc.HTTPBadRequest( _('Unable to create resource provider %(rp_uuid)s: %(error)s') % @@ -331,8 +331,8 @@ def update_resource_provider(req): resource_provider.save() except db_exc.DBDuplicateEntry as exc: raise webob.exc.HTTPConflict( - _('Conflicting resource provider already exists: %(error)s') % - {'error': exc}) + _('Conflicting resource provider %(name)s already exists.') % + {'name': data['name']}) except exception.ObjectActionError as exc: raise webob.exc.HTTPBadRequest( _('Unable to save resource provider %(rp_uuid)s: %(error)s') % diff --git a/nova/tests/functional/api/openstack/placement/gabbits/resource-provider.yaml b/nova/tests/functional/api/openstack/placement/gabbits/resource-provider.yaml index ee37a80d4..239efad49 100644 --- a/nova/tests/functional/api/openstack/placement/gabbits/resource-provider.yaml +++ b/nova/tests/functional/api/openstack/placement/gabbits/resource-provider.yaml @@ -54,7 +54,7 @@ tests: uuid: $ENVIRON['RP_UUID'] status: 409 response_strings: - - Conflicting resource provider already exists + - Conflicting resource provider $ENVIRON['RP_NAME'] already exists response_json_paths: $.errors[0].title: Conflict @@ -67,7 +67,7 @@ tests: uuid: ada30fb5-566d-4fe1-b43b-28a9e988790c status: 409 response_strings: - - Conflicting resource provider already exists + - Conflicting resource provider $ENVIRON['RP_NAME'] already exists response_json_paths: $.errors[0].title: Conflict