Make ROOTDIR determination more robust

Remove unused CLIENTDIR and replace it with a TESTDIR
(pointing to rootdir/keystoneclient/tests) and use
normpath for determining the full path of rootdir.

This change is needed if keystoneclient/ is a symlink
and etc/ is in a different directory hierarchy.

Change-Id: Ice9165ef25ec0200ccfb50c2f2f3121a136652a2
This commit is contained in:
Dirk Mueller
2013-09-27 17:00:19 +02:00
parent 876c2d6c2a
commit e00b7b2f7c

View File

@@ -24,8 +24,8 @@ from keystoneclient.openstack.common import timeutils
from keystoneclient import utils
CLIENTDIR = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
ROOTDIR = os.path.dirname(CLIENTDIR)
TESTDIR = os.path.dirname(os.path.abspath(__file__))
ROOTDIR = os.path.normpath(os.path.join(TESTDIR, '..', '..'))
CERTDIR = os.path.join(ROOTDIR, 'examples', 'pki', 'certs')
CMSDIR = os.path.join(ROOTDIR, 'examples', 'pki', 'cms')