summaryrefslogtreecommitdiffstats
path: root/nova/crypto.py
diff options
context:
space:
mode:
authorVishvananda Ishaya <vishvananda@gmail.com>2012-12-20 21:20:58 -0800
committerVishvananda Ishaya <vishvananda@gmail.com>2012-12-20 21:20:58 -0800
commita8a6e2e82e4f108badaad599570848c5e10ae241 (patch)
tree9b4ee1c0d0d4c4f443d3a20f52893dfa8a4c6b7f /nova/crypto.py
parentaf16e5f24d77f0a11a0ec33af428b45a7c6fecdf (diff)
downloadnova-a8a6e2e82e4f108badaad599570848c5e10ae241.tar.gz
nova-a8a6e2e82e4f108badaad599570848c5e10ae241.tar.xz
nova-a8a6e2e82e4f108badaad599570848c5e10ae241.zip
Makes sure to call crypto scripts with abspath
In some cases __file__ can return a local path instead of an absolute path. For example when you are running with run_tests.sh from a checkout that has been setup.py developed on os x. Make sure that we convert it to an absolute path in case it is relative. Change-Id: Ie18be6039db56601de18ce4ad48791b4abf118fe
Diffstat (limited to 'nova/crypto.py')
-rw-r--r--nova/crypto.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/nova/crypto.py b/nova/crypto.py
index 41e8e9869..37e9daa2a 100644
--- a/nova/crypto.py
+++ b/nova/crypto.py
@@ -108,9 +108,8 @@ def ensure_ca_filesystem():
"""Ensure the CA filesystem exists."""
ca_dir = ca_folder()
if not os.path.exists(ca_path()):
- genrootca_sh_path = os.path.join(os.path.dirname(__file__),
- 'CA',
- 'genrootca.sh')
+ genrootca_sh_path = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), 'CA', 'genrootca.sh'))
start = os.getcwd()
fileutils.ensure_tree(ca_dir)
@@ -251,9 +250,8 @@ def generate_x509_cert(user_id, project_id, bits=1024):
def _ensure_project_folder(project_id):
if not os.path.exists(ca_path(project_id)):
- geninter_sh_path = os.path.join(os.path.dirname(__file__),
- 'CA',
- 'geninter.sh')
+ geninter_sh_path = os.path.abspath(
+ os.path.join(os.path.dirname(__file__), 'CA', 'geninter.sh'))
start = os.getcwd()
os.chdir(ca_folder())
utils.execute('sh', geninter_sh_path, project_id,