Fix improper prompt when update RC with existed one's name.
When update resource class with existed one's name, the exception message was formatted by the updated resource class's name, rather than the required existed one's name. This patch formats the message with existed one's name, and changing tests to add the right name. Change-Id: I78ae8d872748de243d74b9954ce634fccf5e7310 Closes-Bug: #1663163
This commit is contained in:
parent
7b5c3ac11d
commit
ff1133c8ba
|
@ -183,7 +183,7 @@ def update_resource_class(req):
|
|||
except exception.ResourceClassExists:
|
||||
raise webob.exc.HTTPConflict(
|
||||
_('Resource class already exists: %(name)s') %
|
||||
{'name': name},
|
||||
{'name': rc.name},
|
||||
json_formatter=util.json_error_formatter)
|
||||
except exception.ResourceClassCannotUpdateStandard:
|
||||
raise webob.exc.HTTPBadRequest(
|
||||
|
|
|
@ -151,6 +151,7 @@ tests:
|
|||
status: 409
|
||||
response_strings:
|
||||
- Resource class already exists
|
||||
- $ENVIRON['CUSTOM_RES_CLASS']
|
||||
|
||||
- name: update custom resource class
|
||||
PUT: /resource_classes/$ENVIRON['CUSTOM_RES_CLASS']
|
||||
|
|
Loading…
Reference in New Issue