From 338b97a8b9ee8e7ff48da1289d4c85546cfe754d Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 2 Aug 2018 16:00:27 -0400 Subject: [PATCH] qa/rgw: patch keystone requirements.txt an ugly workaround for a python dependency conflict that's broken the rgw/tempest suite. allows us to preserve the pinned versions of keystone/tempest without having to maintain a fork of the keystone repository Fixes: http://tracker.ceph.com/issues/23659 Signed-off-by: Casey Bodley --- qa/tasks/keystone.py | 64 +++++++++++++++++++++++--------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/qa/tasks/keystone.py b/qa/tasks/keystone.py index 1cefa1066cfca..d33512def8654 100644 --- a/qa/tasks/keystone.py +++ b/qa/tasks/keystone.py @@ -45,6 +45,28 @@ def install_packages(ctx, config): for dep in deps[remote.os.package_type]: remove_package(dep, remote) +def get_keystone_dir(ctx): + return '{tdir}/keystone'.format(tdir=teuthology.get_testdir(ctx)) + +def run_in_keystone_dir(ctx, client, args): + ctx.cluster.only(client).run( + args=[ 'cd', get_keystone_dir(ctx), run.Raw('&&'), ] + args, + ) + +def run_in_keystone_venv(ctx, client, args): + run_in_keystone_dir(ctx, client, + [ 'source', + '.tox/venv/bin/activate', + run.Raw('&&') + ] + args) + +def get_keystone_venved_cmd(ctx, cmd, args): + kbindir = get_keystone_dir(ctx) + '/.tox/venv/bin/' + return [ kbindir + 'python', kbindir + cmd ] + args + +def get_toxvenv_dir(ctx): + return ctx.tox.venv_path + @contextlib.contextmanager def download(ctx, config): """ @@ -56,7 +78,7 @@ def download(ctx, config): """ assert isinstance(config, dict) log.info('Downloading keystone...') - testdir = teuthology.get_testdir(ctx) + keystonedir = get_keystone_dir(ctx) for (client, cconf) in config.items(): ctx.cluster.only(client).run( @@ -64,51 +86,33 @@ def download(ctx, config): 'git', 'clone', '-b', cconf.get('force-branch', 'master'), 'https://github.com/openstack/keystone.git', - '{tdir}/keystone'.format(tdir=testdir), + keystonedir, ], ) sha1 = cconf.get('sha1') if sha1 is not None: - ctx.cluster.only(client).run( - args=[ - 'cd', '{tdir}/keystone'.format(tdir=testdir), - run.Raw('&&'), + run_in_keystone_dir(ctx, client, [ 'git', 'reset', '--hard', sha1, ], ) + + # hax for http://tracker.ceph.com/issues/23659 + run_in_keystone_dir(ctx, client, [ + 'sed', '-i', + 's/pysaml2<4.0.3,>=2.4.0/pysaml2>=4.5.0/', + 'requirements.txt' + ], + ) try: yield finally: log.info('Removing keystone...') - testdir = teuthology.get_testdir(ctx) for client in config: ctx.cluster.only(client).run( - args=[ 'rm', '-rf', '{tdir}/keystone'.format(tdir=testdir) ], + args=[ 'rm', '-rf', keystonedir ], ) -def get_keystone_dir(ctx): - return '{tdir}/keystone'.format(tdir=teuthology.get_testdir(ctx)) - -def run_in_keystone_dir(ctx, client, args): - ctx.cluster.only(client).run( - args=[ 'cd', get_keystone_dir(ctx), run.Raw('&&'), ] + args, - ) - -def run_in_keystone_venv(ctx, client, args): - run_in_keystone_dir(ctx, client, - [ 'source', - '.tox/venv/bin/activate', - run.Raw('&&') - ] + args) - -def get_keystone_venved_cmd(ctx, cmd, args): - kbindir = get_keystone_dir(ctx) + '/.tox/venv/bin/' - return [ kbindir + 'python', kbindir + cmd ] + args - -def get_toxvenv_dir(ctx): - return ctx.tox.venv_path - @contextlib.contextmanager def setup_venv(ctx, config): """ -- 2.39.5