From 222a0e66f732ea0331c566d1f6b4d6abb990cc04 Mon Sep 17 00:00:00 2001 From: Corey Bryant Date: Tue, 12 May 2015 20:43:48 +0000 Subject: [PATCH] Add rbd.py and rados.py symlinks and drop python-cephclient --- hooks/cinder_utils.py | 10 +++++++++- unit_tests/test_cinder_utils.py | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hooks/cinder_utils.py b/hooks/cinder_utils.py index 8905c7f2..4550dddb 100644 --- a/hooks/cinder_utils.py +++ b/hooks/cinder_utils.py @@ -575,7 +575,7 @@ def git_pre_install(): def git_post_install(projects_yaml): """Perform cinder post-install setup.""" http_proxy = git_yaml_value(projects_yaml, 'http_proxy') - base_packages = ['mysql-python', 'python-cephclient'] + base_packages = ['mysql-python'] for pkg in base_packages: if http_proxy: pip_install(pkg, proxy=http_proxy, @@ -602,6 +602,14 @@ def git_post_install(projects_yaml): {'src': os.path.join(git_pip_venv_dir(projects_yaml), 'bin/cinder-rootwrap'), 'link': '/usr/local/bin/cinder-rootwrap'}, + # NOTE(coreycb): This is ugly but couldn't find pypi package that + # installs rbd.py and rados.py. + {'src': '/usr/lib/python2.7/dist-packages/rbd.py', + 'link': os.path.join(git_pip_venv_dir(projects_yaml), + 'lib/python2.7/site-packages/rbd.py')}, + {'src': '/usr/lib/python2.7/dist-packages/rados.py', + 'link': os.path.join(git_pip_venv_dir(projects_yaml), + 'lib/python2.7/site-packages/rados.py')}, ] for s in symlinks: diff --git a/unit_tests/test_cinder_utils.py b/unit_tests/test_cinder_utils.py index e2e025b2..761e4ab7 100644 --- a/unit_tests/test_cinder_utils.py +++ b/unit_tests/test_cinder_utils.py @@ -596,6 +596,8 @@ class TestCinderUtils(CharmTestCase): expected = [ call('joined-string', '/usr/local/bin/cinder-manage'), + call('/usr/lib/python2.7/dist-packages/rbd.py', 'joined-string'), + call('/usr/lib/python2.7/dist-packages/rados.py', 'joined-string'), ] symlink.assert_has_calls(expected, any_order=True)