From 634cd664f7572f70ffaeffa52a9a61607cd1ddca Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 7 Oct 2011 17:00:30 +0200 Subject: Fix possible_topdir computing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Using sys.argv[0] is wrong: if you run /usr/bin/keystone, it will look for templates in /usr/keystone/… which will not work. The template path is relative to the version.py file, so using __file__ makes things work. Change-Id: I90e930bbb320b148df0fb7234a824b3644bd7369 Signed-off-by: Julien Danjou --- AUTHORS | 1 + keystone/controllers/version.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index 7936b430..efaa4389 100644 --- a/AUTHORS +++ b/AUTHORS @@ -16,6 +16,7 @@ John Dickinson John Eo Jorge L. Williams Josh Kearney +Julien Danjou Kevin L. Mitchell Khaled Hussein Mark Gius diff --git a/keystone/controllers/version.py b/keystone/controllers/version.py index d969a1ab..9b965fdf 100644 --- a/keystone/controllers/version.py +++ b/keystone/controllers/version.py @@ -1,12 +1,12 @@ import os -import sys from webob import Response # If ../../keystone/__init__.py exists, add ../ to Python search path, so that # it will override what happens to be installed in /usr/(local/)lib/python... -possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]), - os.pardir, - os.pardir)) +possible_topdir = os.path.normpath(os.path.join(os.path.abspath(__file__), + os.pardir, + os.pardir, + os.pardir)) from keystone import utils from keystone.common import template, wsgi -- cgit