Merge "Error message should not include SQL command"

This commit is contained in:
Jenkins 2017-03-20 13:22:48 +00:00 committed by Gerrit Code Review
commit 4b79d3e631
2 changed files with 6 additions and 6 deletions

View File

@ -185,8 +185,8 @@ def create_resource_provider(req):
resource_provider.create() resource_provider.create()
except db_exc.DBDuplicateEntry as exc: except db_exc.DBDuplicateEntry as exc:
raise webob.exc.HTTPConflict( raise webob.exc.HTTPConflict(
_('Conflicting resource provider already exists: %(error)s') % _('Conflicting resource provider %(name)s already exists.') %
{'error': exc}) {'name': data['name']})
except exception.ObjectActionError as exc: except exception.ObjectActionError as exc:
raise webob.exc.HTTPBadRequest( raise webob.exc.HTTPBadRequest(
_('Unable to create resource provider %(rp_uuid)s: %(error)s') % _('Unable to create resource provider %(rp_uuid)s: %(error)s') %
@ -331,8 +331,8 @@ def update_resource_provider(req):
resource_provider.save() resource_provider.save()
except db_exc.DBDuplicateEntry as exc: except db_exc.DBDuplicateEntry as exc:
raise webob.exc.HTTPConflict( raise webob.exc.HTTPConflict(
_('Conflicting resource provider already exists: %(error)s') % _('Conflicting resource provider %(name)s already exists.') %
{'error': exc}) {'name': data['name']})
except exception.ObjectActionError as exc: except exception.ObjectActionError as exc:
raise webob.exc.HTTPBadRequest( raise webob.exc.HTTPBadRequest(
_('Unable to save resource provider %(rp_uuid)s: %(error)s') % _('Unable to save resource provider %(rp_uuid)s: %(error)s') %

View File

@ -54,7 +54,7 @@ tests:
uuid: $ENVIRON['RP_UUID'] uuid: $ENVIRON['RP_UUID']
status: 409 status: 409
response_strings: response_strings:
- Conflicting resource provider already exists - Conflicting resource provider $ENVIRON['RP_NAME'] already exists
response_json_paths: response_json_paths:
$.errors[0].title: Conflict $.errors[0].title: Conflict
@ -67,7 +67,7 @@ tests:
uuid: ada30fb5-566d-4fe1-b43b-28a9e988790c uuid: ada30fb5-566d-4fe1-b43b-28a9e988790c
status: 409 status: 409
response_strings: response_strings:
- Conflicting resource provider already exists - Conflicting resource provider $ENVIRON['RP_NAME'] already exists
response_json_paths: response_json_paths:
$.errors[0].title: Conflict $.errors[0].title: Conflict