Keystone tests determine rootdir relative to pwd

Bug #1241198 reported by Dirk Mueller
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Invalid
Low
Dirk Mueller
Havana
Fix Released
Low
Dirk Mueller

Bug Description

keystone/tests/core.py

contains this code:

  ROOTDIR = os.path.dirname(os.path.abspath('..'))

which is determining the abspath of $PWD/..

A more reliable way to determine the rootdir is relative to the dirname(__file__) of the python module itself.

Changed in keystone:
assignee: nobody → Dirk Mueller (dmllr)
status: New → In Progress
Revision history for this message
Dolph Mathews (dolph) wrote :

There's actually a fix for this already in review, by either bkhudson or dstanek.

Changed in keystone:
importance: Undecided → Low
Revision history for this message
David Stanek (dstanek) wrote :
Revision history for this message
Dolph Mathews (dolph) wrote :

Cool, thanks!

Changed in keystone:
status: In Progress → Invalid
tags: added: havana-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to keystone (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/53623

Revision history for this message
Alan Pevec (apevec) wrote :

I'd like to see more justification before approving for stable, this bug is set as Low and it doesn't describe in which situation/setup it shows up?

Revision history for this message
Dolph Mathews (dolph) wrote :

My reasoning for the Low priority is that it only affects test execution rather than the core functionality of the project. The root directory will be incorrectly determined if the working directory happens to not be in keystone/ -- making the tests a bit fragile. Basing directory resolution on __file__ makes it completely unambiguous.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to keystone (stable/havana)

Reviewed: https://review.openstack.org/53623
Committed: http://github.com/openstack/keystone/commit/838e4d3802be1ff1f856ced629b6d6eba4bd9158
Submitter: Jenkins
Branch: stable/havana

commit 838e4d3802be1ff1f856ced629b6d6eba4bd9158
Author: Dirk Mueller <email address hidden>
Date: Thu Oct 24 15:29:53 2013 +0200

    Fix Rootdir determination

    This is a partial backport of I15c1707eb6a62c74a0021a48b89ae15f03fcfea8

    Change-Id: Ia4c490e2e2cd0851bb378f1db4116a955a6ad845
    Fixes-Bug: #1241198

Alan Pevec (apevec)
tags: removed: havana-backport-potential
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.