summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWalter Doekes <walter+github@wjd.nu>2019-11-01 15:34:41 +0100
committerAkihiro Motoki <amotoki@gmail.com>2020-05-02 00:43:20 +0000
commit11cce6e71be994683b442e02d00e194edb1fa65f (patch)
treeb98f3661060b425fe242e41f678a0ce7d4171c9f
parent510757b6b30aad01b8fbb4f2929c4370e64b81bd (diff)
downloadhorizon-11cce6e71be994683b442e02d00e194edb1fa65f.tar.gz
Give keystoneauth1.ClientException only 1 argument (message)
Change-Id: I970b07e52ed7f2f4440b47800fcb3b6528dce22d (cherry picked from commit 941f64915e825dedc2c58621e8390953bfcc4b7b)
-rw-r--r--openstack_auth/tests/unit/test_auth.py3
-rw-r--r--openstack_dashboard/api/keystone.py4
-rw-r--r--openstack_dashboard/dashboards/identity/domains/tables.py2
3 files changed, 5 insertions, 4 deletions
diff --git a/openstack_auth/tests/unit/test_auth.py b/openstack_auth/tests/unit/test_auth.py
index bb663042e..b87d2bfbf 100644
--- a/openstack_auth/tests/unit/test_auth.py
+++ b/openstack_auth/tests/unit/test_auth.py
@@ -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)
diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py
index 96d6dd455..74691f0e8 100644
--- a/openstack_dashboard/api/keystone.py
+++ b/openstack_dashboard/api/keystone.py
@@ -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)
diff --git a/openstack_dashboard/dashboards/identity/domains/tables.py b/openstack_dashboard/dashboards/identity/domains/tables.py
index 8c0dbf725..7fb879f96 100644
--- a/openstack_dashboard/dashboards/identity/domains/tables.py
+++ b/openstack_dashboard/dashboards/identity/domains/tables.py
@@ -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)