]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/keystone.py: centos-8 bindep fix
authorMarcus Watts <mwatts@redhat.com>
Thu, 14 Jan 2021 18:14:11 +0000 (13:14 -0500)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Feb 2021 16:04:38 +0000 (11:04 -0500)
The upstream git repository for keystone contains a dependency
for "python34-devel" which only exists in centos 7.
For centos 8, the correct package is "python36-devel".
So, patch bindep.txt before running bindep.

Fixes: https://tracker.ceph.com/issues/48920
Signed-off-by: Marcus Watts <mwatts@redhat.com>
(cherry picked from commit 5258b20bf00a3ee9c278fdd605cc0dd9f80973a4)

qa/tasks/keystone.py

index 74fa27abacc75a795a56fc59506eeca55b2ebeaa..ad836006fffc926698eabc7a586eddbeafe40903 100644 (file)
@@ -92,6 +92,22 @@ def download(ctx, config):
                 args=[ 'rm', '-rf', keystonedir ],
             )
 
+patch_bindep_template = """\
+import fileinput
+import sys
+import os
+fixed=False
+os.chdir("{keystone_dir}")
+for line in fileinput.input("bindep.txt", inplace=True):
+ if line == "python34-devel [platform:centos]\\n":
+  line="python34-devel [platform:centos-7]\\npython36-devel [platform:centos-8]\\n" 
+  fixed=True
+ print(line,end="")
+
+print("Fixed line" if fixed else "No fix necessary", file=sys.stderr)
+exit(0)
+"""
+
 @contextlib.contextmanager
 def install_packages(ctx, config):
     """
@@ -104,9 +120,12 @@ def install_packages(ctx, config):
     assert isinstance(config, dict)
     log.info('Installing packages for Keystone...')
 
+    patch_bindep = patch_bindep_template \
+        .replace("{keystone_dir}", get_keystone_dir(ctx))
     packages = {}
     for (client, _) in config.items():
         (remote,) = ctx.cluster.only(client).remotes.keys()
+        toxvenv_sh(ctx, remote, ['python'], stdin=patch_bindep)
         # use bindep to read which dependencies we need from keystone/bindep.txt
         toxvenv_sh(ctx, remote, ['pip', 'install', 'bindep'])
         packages[client] = toxvenv_sh(ctx, remote,