yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #46063
[Bug 1543073] Re: keystoneclient API misused in MappingsViewTests
Reviewed: https://review.openstack.org/275265
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=68de5710973a3d5db79de18150ca6440635c7a9a
Submitter: Jenkins
Branch: master
commit 68de5710973a3d5db79de18150ca6440635c7a9a
Author: Victor Stinner <vstinner@xxxxxxxxxx>
Date: Tue Feb 2 16:23:53 2016 +0100
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@xxxxxxxxxxxx>
Closes-Bug: 1543073
Partial-Implements: blueprint porting-python3
Change-Id: I066359734624023b3f3776e8dbd54237d298e455
** Changed in: horizon
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1543073
Title:
keystoneclient API misused in MappingsViewTests
Status in OpenStack Dashboard (Horizon):
Fix Released
Bug description:
The test
openstack_dashboard.dashboards.identity.mappings.tests.MappingsViewTests.test_index()
uses a keystoneclient.v3.contrib.federation.mappings.Mapping object
created by the data() function of
openstack_dashboard/test/test_data/keystone_data.py. Problem: data()
pass the keystoneclient.v3.contrib.federation.mappings.MappingManager
*class* to Mapping constructor, whereas it should pass an instance.
keystoneclient.v3.contrib.federation.mappings.MappingManager
constructor (keystoneclient.base.Manager constructor) has a client
parameter but I don't know how to create such client: "instance of
BaseClient descendant for HTTP requests".
The bug is hidden on Python 2 in
horizon.tables.base.DataTable.get_object_display() by hasattr(datum,
'name'), because hasattr() ignores *all* exceptions.
I found this bug when running the test on Python 3, since hasattr()
now only catchs AttributeError.
I proposed https://review.openstack.org/#/c/275265/ to mimick
hasattr() Python 2 beheaviour on Python 3 in
horizon.tables.base.DataTable.get_object_display().
To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1543073/+subscriptions
References