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 <tsufiev@mirantis.com>
Closes-Bug: 1543073
Partial-Implements: blueprint porting-python3
Change-Id: I066359734624023b3f3776e8dbd54237d298e455
This commit is contained in:
Victor Stinner 2016-02-02 16:23:53 +01:00
parent de3ae40fb5
commit 68de571097
3 changed files with 3 additions and 4 deletions

View File

@ -1685,9 +1685,7 @@ class DataTable(object):
By default, this returns a ``name`` attribute from the given object, By default, this returns a ``name`` attribute from the given object,
but this can be overridden to return other values. but this can be overridden to return other values.
""" """
if hasattr(datum, 'name'): return getattr(datum, 'name', None)
return datum.name
return None
def has_prev_data(self): def has_prev_data(self):
"""Returns a boolean value indicating whether there is previous data """Returns a boolean value indicating whether there is previous data

View File

@ -422,6 +422,6 @@ def data(TEST):
] ]
} }
idp_mapping = mappings.Mapping( idp_mapping = mappings.Mapping(
mappings.MappingManager, mappings.MappingManager(None),
idp_mapping_dict) idp_mapping_dict)
TEST.idp_mappings.add(idp_mapping) TEST.idp_mappings.add(idp_mapping)

View File

@ -29,6 +29,7 @@ commands =
openstack_dashboard.dashboards.admin.metering \ openstack_dashboard.dashboards.admin.metering \
openstack_dashboard.dashboards.admin.routers \ openstack_dashboard.dashboards.admin.routers \
openstack_dashboard.dashboards.admin.volumes.volumes.tests \ openstack_dashboard.dashboards.admin.volumes.volumes.tests \
openstack_dashboard.dashboards.identity.identity_providers \
openstack_dashboard.dashboards.identity.users \ openstack_dashboard.dashboards.identity.users \
openstack_dashboard.dashboards.project.access_and_security.api_access.tests \ openstack_dashboard.dashboards.project.access_and_security.api_access.tests \
openstack_dashboard.dashboards.project.images \ openstack_dashboard.dashboards.project.images \