Give keystoneauth1.ClientException only 1 argument (message)

Change-Id: I970b07e52ed7f2f4440b47800fcb3b6528dce22d
This commit is contained in:
Walter Doekes 2019-11-01 15:34:41 +01:00 committed by Akihiro Motoki
parent 58ad91595d
commit 941f64915e
3 changed files with 5 additions and 4 deletions

View File

@ -1054,7 +1054,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

@ -437,7 +437,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:
@ -455,7 +455,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)