From 5258b20bf00a3ee9c278fdd605cc0dd9f80973a4 Mon Sep 17 00:00:00 2001 From: Marcus Watts Date: Thu, 14 Jan 2021 13:14:11 -0500 Subject: [PATCH] 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 --- qa/tasks/keystone.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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,