From 7a9552d892a1d24503b0b7226314d44c8ce73d57 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Thu, 7 May 2015 14:48:10 +0000 Subject: [PATCH] Use git_pip_venv_dir to get venv path --- hooks/cinder_utils.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/hooks/cinder_utils.py b/hooks/cinder_utils.py index f86d10aa..c6450aa5 100644 --- a/hooks/cinder_utils.py +++ b/hooks/cinder_utils.py @@ -7,7 +7,6 @@ from copy import copy from charmhelpers.contrib.python.packages import ( pip_install, - pip_get_virtualenv_path, ) from charmhelpers.core.hookenv import ( @@ -75,6 +74,7 @@ from charmhelpers.contrib.openstack.utils import ( git_clone_and_install, git_src_dir, git_yaml_value, + git_pip_venv_dir, os_release, ) @@ -575,9 +575,11 @@ def git_post_install(projects_yaml): """Perform cinder post-install setup.""" http_proxy = git_yaml_value(projects_yaml, 'http_proxy') if http_proxy: - pip_install('mysql-python', proxy=http_proxy, venv=True) + pip_install('mysql-python', proxy=http_proxy, + venv=git_pip_venv_dir(projects_yaml)) else: - pip_install('mysql-python', venv=True) + pip_install('mysql-python', + venv=git_pip_venv_dir(projects_yaml)) src_etc = os.path.join(git_src_dir(projects_yaml, 'cinder'), 'etc/cinder') configs = { @@ -590,7 +592,8 @@ def git_post_install(projects_yaml): shutil.copytree(configs['src'], configs['dest']) symlinks = [ - {'src': os.path.join(pip_get_virtualenv_path(), 'bin/cinder-manage'), + {'src': os.path.join(git_pip_venv_dir(projects_yaml), + 'bin/cinder-manage'), 'link': '/usr/local/bin/cinder-manage'}, ] @@ -610,7 +613,7 @@ def git_post_install(projects_yaml): os.chmod('/etc/sudoers.d', 0o750) - bin_dir = os.path.join(pip_get_virtualenv_path(), 'bin') + bin_dir = os.path.join(git_pip_venv_dir(projects_yaml), 'bin') cinder_api_context = { 'service_description': 'Cinder API server', 'service_name': 'Cinder',