Merge "Give keystoneauth1.ClientException only 1 argument (message)" into stable/ussuri

This commit is contained in:
Zuul 2020-06-23 18:53:47 +00:00 committed by Gerrit Code Review
commit 88a60913f0
3 changed files with 5 additions and 4 deletions

View File

@ -1055,7 +1055,8 @@ class OpenStackAuthTestsV3WithMock(test.TestCase):
form_data = self.get_form_data(user)
url = reverse('login')
mock_get_access.side_effect = keystone_exceptions.ClientException(500)
mock_get_access.side_effect = \
keystone_exceptions.ClientException('error 500')
# GET the page to set the test cookie.
response = self.client.get(url, form_data)

View File

@ -438,7 +438,7 @@ def user_update(request, user, **data):
if not keystone_can_edit_user():
raise keystone_exceptions.ClientException(
405, _("Identity service does not allow editing user data."))
_("Identity service does not allow editing user data."))
try:
user = manager.update(user, **data)
except keystone_exceptions.Conflict:
@ -456,7 +456,7 @@ def user_update_password(request, user, password, admin=True):
if not keystone_can_edit_user():
raise keystone_exceptions.ClientException(
405, _("Identity service does not allow editing user password."))
_("Identity service does not allow editing user password."))
manager = keystoneclient(request, admin=admin).users
manager.update(user, password=password)

View File

@ -116,7 +116,7 @@ class DeleteDomainsAction(tables.DeleteAction):
msg = _('Domain "%s" must be disabled before it can be deleted.') \
% domain.name
messages.error(request, msg)
raise keystoneclient_exceptions.ClientException(409, msg)
raise keystoneclient_exceptions.ClientException(msg)
else:
LOG.info('Deleting domain "%s".', obj_id)
api.keystone.domain_delete(request, obj_id)