Keystone tests determine rootdir relative to pwd

Bug #1241198 reported by Dirk Mueller on 2013-10-17
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Low
Dirk Mueller
Havana
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
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
David Stanek (dstanek) wrote :
Dolph Mathews (dolph) wrote :

Cool, thanks!

Changed in keystone:
status: In Progress → Invalid
tags: added: havana-backport-potential
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?

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.

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) on 2013-12-08
tags: removed: havana-backport-potential
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers