summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulien Danjou <julien.danjou@enovance.com>2011-10-07 17:00:30 +0200
committerJulien Danjou <julien.danjou@enovance.com>2011-10-10 10:34:10 +0200
commit634cd664f7572f70ffaeffa52a9a61607cd1ddca (patch)
treef2049c9a89575a19cb17496bed205f9982eda0da
parent5fa576a1b772801bf35bd74875b1a1efae3ce086 (diff)
downloadkeystone-634cd664f7572f70ffaeffa52a9a61607cd1ddca.tar.gz
keystone-634cd664f7572f70ffaeffa52a9a61607cd1ddca.tar.xz
keystone-634cd664f7572f70ffaeffa52a9a61607cd1ddca.zip
Fix possible_topdir computing
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 <julien.danjou@enovance.com>
-rw-r--r--AUTHORS1
-rw-r--r--keystone/controllers/version.py8
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 <me@not.mn>
John Eo <joon.eo@gmail.com>
Jorge L. Williams <jorge.williams@rackspace.com>
Josh Kearney <josh@jk0.org>
+Julien Danjou <julien.danjou@enovance.com>
Kevin L. Mitchell <kevin.mitchell@rackspace.com>
Khaled Hussein <khaled.hussein@gmail.com>
Mark Gius <mgius7096@gmail.com>
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