mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
tasks/ceph-deploy: Install appropriate Python version before running
Related to RM-15016 Signed-off-by: Oleh Prypin <oleh@pryp.in>
This commit is contained in:
parent
9c1a28210e
commit
c5dbbfc545
@ -27,9 +27,38 @@ def download_ceph_deploy(ctx, config):
|
||||
will use that instead. The `bootstrap` script is ran, with the argument
|
||||
obtained from `python_version`, if specified.
|
||||
"""
|
||||
ceph_admin = ctx.cluster.only(teuthology.get_first_mon(ctx, config))
|
||||
|
||||
try:
|
||||
py_ver = str(config['python_version'])
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
supported_versions = ['2', '3']
|
||||
if py_ver not in supported_versions:
|
||||
raise ValueError("python_version must be: {}, not {}".format(
|
||||
' or '.join(supported_versions), py_ver
|
||||
))
|
||||
|
||||
log.info("Installing Python")
|
||||
for admin in ceph_admin.remotes:
|
||||
system_type = teuthology.get_system_type(admin)
|
||||
|
||||
if system_type == 'rpm':
|
||||
package = 'python34' if py_ver == '3' else 'python'
|
||||
ctx.cluster.run(args=[
|
||||
'sudo', 'yum', '-y', 'install',
|
||||
package, 'python-virtualenv'
|
||||
])
|
||||
else:
|
||||
package = 'python3' if py_ver == '3' else 'python'
|
||||
ctx.cluster.run(args=[
|
||||
'sudo', 'apt-get', '-y', '--force-yes', 'install',
|
||||
package, 'python-virtualenv'
|
||||
])
|
||||
|
||||
log.info('Downloading ceph-deploy...')
|
||||
testdir = teuthology.get_testdir(ctx)
|
||||
ceph_admin = ctx.cluster.only(teuthology.get_first_mon(ctx, config))
|
||||
ceph_deploy_branch = config.get('ceph-deploy-branch', 'master')
|
||||
|
||||
ceph_admin.run(
|
||||
|
Loading…
Reference in New Issue
Block a user