]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/rgw: patch keystone requirements.txt 23402/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 2 Aug 2018 20:00:27 +0000 (16:00 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 2 Aug 2018 20:43:42 +0000 (16:43 -0400)
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 <cbodley@redhat.com>
qa/tasks/keystone.py

index 1cefa1066cfca4506675ca28328d0648a699a5b0..d33512def86541f27c00910a4c29d6229cfd2512 100644 (file)
@@ -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):
     """