From: Marcus Watts Date: Thu, 14 Jan 2021 18:14:11 +0000 (-0500) Subject: qa/tasks/keystone.py: centos-8 bindep fix X-Git-Tag: v16.2.0~170^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2f9895fbf57ad24f599e8d647c9eb74cdf819c99;p=ceph.git qa/tasks/keystone.py: centos-8 bindep fix 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 (cherry picked from commit 5258b20bf00a3ee9c278fdd605cc0dd9f80973a4) --- diff --git a/qa/tasks/keystone.py b/qa/tasks/keystone.py index 74fa27abacc..ad836006fff 100644 --- a/qa/tasks/keystone.py +++ b/qa/tasks/keystone.py @@ -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,