From df92b1113d6e00af05b5f06d0c10a39875bbbde6 Mon Sep 17 00:00:00 2001 From: Walter Doekes Date: Fri, 1 Nov 2019 15:34:41 +0100 Subject: [PATCH] Give keystoneauth1.ClientException only 1 argument (message) Change-Id: I970b07e52ed7f2f4440b47800fcb3b6528dce22d (cherry picked from commit 941f64915e825dedc2c58621e8390953bfcc4b7b) --- openstack_auth/tests/unit/test_auth.py | 2 +- openstack_dashboard/api/keystone.py | 4 ++-- openstack_dashboard/dashboards/identity/domains/tables.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/openstack_auth/tests/unit/test_auth.py b/openstack_auth/tests/unit/test_auth.py index a668f2a7f0..60a4a07862 100644 --- a/openstack_auth/tests/unit/test_auth.py +++ b/openstack_auth/tests/unit/test_auth.py @@ -376,7 +376,7 @@ class OpenStackAuthTestsV3(OpenStackAuthTestsMixin, def test_exception(self): user = self.data.user form_data = self.get_form_data(user) - exc = keystone_exceptions.ClientException(500) + exc = keystone_exceptions.ClientException('error 500') self._mock_client_password_auth_failure(user.name, user.password, exc) self.mox.ReplayAll() diff --git a/openstack_dashboard/api/keystone.py b/openstack_dashboard/api/keystone.py index cbf2da107d..afa0148548 100644 --- a/openstack_dashboard/api/keystone.py +++ b/openstack_dashboard/api/keystone.py @@ -436,7 +436,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: @@ -454,7 +454,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 8c0dbf725a..7fb879f96f 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)