From 9c1a28210e06318303bb7fe2eccef7d8fb982a0b Mon Sep 17 00:00:00 2001 From: Oleh Prypin Date: Fri, 27 May 2016 00:17:13 +0300 Subject: [PATCH] tasks/ceph-deploy: Run on multiple Python versions (2, 3) Related to RM-15016 Signed-off-by: Oleh Prypin --- .../basic/python_versions/python_2.yaml | 3 +++ .../basic/python_versions/python_3.yaml | 3 +++ tasks/ceph_deploy.py | 22 +++++++++++-------- 3 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 suites/ceph-deploy/basic/python_versions/python_2.yaml create mode 100644 suites/ceph-deploy/basic/python_versions/python_3.yaml diff --git a/suites/ceph-deploy/basic/python_versions/python_2.yaml b/suites/ceph-deploy/basic/python_versions/python_2.yaml new file mode 100644 index 00000000000..51c865bfa87 --- /dev/null +++ b/suites/ceph-deploy/basic/python_versions/python_2.yaml @@ -0,0 +1,3 @@ +overrides: + ceph-deploy: + python_version: "2" diff --git a/suites/ceph-deploy/basic/python_versions/python_3.yaml b/suites/ceph-deploy/basic/python_versions/python_3.yaml new file mode 100644 index 00000000000..22deecaeab6 --- /dev/null +++ b/suites/ceph-deploy/basic/python_versions/python_3.yaml @@ -0,0 +1,3 @@ +overrides: + ceph-deploy: + python_version: "3" diff --git a/tasks/ceph_deploy.py b/tasks/ceph_deploy.py index bb985e294c4..30ef01d433f 100644 --- a/tasks/ceph_deploy.py +++ b/tasks/ceph_deploy.py @@ -24,7 +24,8 @@ def download_ceph_deploy(ctx, config): """ Downloads ceph-deploy from the ceph.com git mirror and (by default) switches to the master branch. If the `ceph-deploy-branch` is specified, it - will use that instead. + will use that instead. The `bootstrap` script is ran, with the argument + obtained from `python_version`, if specified. """ log.info('Downloading ceph-deploy...') testdir = teuthology.get_testdir(ctx) @@ -38,14 +39,17 @@ def download_ceph_deploy(ctx, config): '{tdir}/ceph-deploy'.format(tdir=testdir), ], ) - ceph_admin.run( - args=[ - 'cd', - '{tdir}/ceph-deploy'.format(tdir=testdir), - run.Raw('&&'), - './bootstrap', - ], - ) + args = [ + 'cd', + '{tdir}/ceph-deploy'.format(tdir=testdir), + run.Raw('&&'), + './bootstrap', + ] + try: + args.append(str(config['python_version'])) + except KeyError: + pass + ceph_admin.run(args=args) try: yield -- 2.39.5