From 68de5710973a3d5db79de18150ca6440635c7a9a Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Tue, 2 Feb 2016 16:23:53 +0100 Subject: [PATCH] Port identity provider dashboard to Python 3 * Fix usage of Mapping() of keystoneclient.v3.contrib.federation: pass a manager instance, not a manager class. * Simplify DataTable.get_object_display(). * tox.ini: add identity_providers to Python 3.4. Co-Authored-By: Timur Sufiev Closes-Bug: 1543073 Partial-Implements: blueprint porting-python3 Change-Id: I066359734624023b3f3776e8dbd54237d298e455 --- horizon/tables/base.py | 4 +--- openstack_dashboard/test/test_data/keystone_data.py | 2 +- tox.ini | 1 + 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/horizon/tables/base.py b/horizon/tables/base.py index 4088e1826..51a3affa5 100644 --- a/horizon/tables/base.py +++ b/horizon/tables/base.py @@ -1685,9 +1685,7 @@ class DataTable(object): By default, this returns a ``name`` attribute from the given object, but this can be overridden to return other values. """ - if hasattr(datum, 'name'): - return datum.name - return None + return getattr(datum, 'name', None) def has_prev_data(self): """Returns a boolean value indicating whether there is previous data diff --git a/openstack_dashboard/test/test_data/keystone_data.py b/openstack_dashboard/test/test_data/keystone_data.py index a1e9db677..c4a831ace 100644 --- a/openstack_dashboard/test/test_data/keystone_data.py +++ b/openstack_dashboard/test/test_data/keystone_data.py @@ -422,6 +422,6 @@ def data(TEST): ] } idp_mapping = mappings.Mapping( - mappings.MappingManager, + mappings.MappingManager(None), idp_mapping_dict) TEST.idp_mappings.add(idp_mapping) diff --git a/tox.ini b/tox.ini index d00a5d674..7ab33db8f 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,7 @@ commands = openstack_dashboard.dashboards.admin.metering \ openstack_dashboard.dashboards.admin.routers \ openstack_dashboard.dashboards.admin.volumes.volumes.tests \ + openstack_dashboard.dashboards.identity.identity_providers \ openstack_dashboard.dashboards.identity.users \ openstack_dashboard.dashboards.project.access_and_security.api_access.tests \ openstack_dashboard.dashboards.project.images \