From 75570ce6a436fdec81f9aa720759a79d71a894f7 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Wed, 1 Jul 2020 16:32:33 +0800 Subject: [PATCH] qa/keystone: pin python-openstackclient and osc-lib keystone's dependencies are installed using its tox.ini, which in turn uses a constraints file of https://releases.openstack.org/constraints/upper/ussuri, and it pins cliff to 3.1.0, which is not able to fulfill the requirement of osc-lib 2.2.0. as it needs needs cliff>=3.2.0. per https://releases.openstack.org/ussuri/, the latest osc-lib for ussuri is 2.0.0. and osc-lib>=2.0.0 is required by python-openstackclient 2.5.1, so let's use it instead of using the latest one. if we install cliff==3.1.0 along with python-openstackclient==5.2.1, we will have following error, as `CommandManager.add_command_group()` method was added to cliff in 3.2.0. see https://opendev.org/openstack/cliff/commit/8477c4dbd0cf651b9b4ba4a4934de69d5942bfc2, so cliff failed to work with the latest openstackclient, like: 2020-06-29T17:26:23.402 INFO:teuthology.orchestra.run.smithi039.stderr:'CommandManager' object has no attribute 'add_command_group' 2020-06-29T17:26:23.402 INFO:teuthology.orchestra.run.smithi039.stderr:Traceback (most recent call last): 2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/cliff/app.py", line 264, in run 2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr: self.initialize_app(remainder) 2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 133, in initialize_app 2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr: super(OpenStackShell, self).initialize_app(argv) 2020-06-29T17:26:23.403 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 442, in initialize_app 2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr: self._load_plugins() 2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 104, in _load_plugins 2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr: self.command_manager.add_command_group(cmd_group) 2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:AttributeError: 'CommandManager' object has no attribute 'add_command_group' 2020-06-29T17:26:23.404 INFO:teuthology.orchestra.run.smithi039.stderr:Traceback (most recent call last): 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 134, in run 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: ret_val = super(OpenStackShell, self).run(argv) 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/cliff/app.py", line 264, in run 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: self.initialize_app(remainder) 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 133, in initialize_app 2020-06-29T17:26:23.405 INFO:teuthology.orchestra.run.smithi039.stderr: super(OpenStackShell, self).initialize_app(argv) 2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/osc_lib/shell.py", line 442, in initialize_app 2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr: self._load_plugins() 2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr: File "/home/ubuntu/cephtest/keystone/.tox/venv/lib/python3.6/site-packages/openstackclient/shell.py", line 104, in _load_plugins 2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr: self.command_manager.add_command_group(cmd_group) 2020-06-29T17:26:23.406 INFO:teuthology.orchestra.run.smithi039.stderr:AttributeError: 'CommandManager' object has no attribute 'add_command_group' in this change the openstackclients version is pin'ed to the latest stable of 5.2.1. will have a separated PR to bump up the cliff version on teuthology side. Signed-off-by: Kefu Chai --- qa/tasks/keystone.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qa/tasks/keystone.py b/qa/tasks/keystone.py index bcb10060220e3..b229ae6a8e971 100644 --- a/qa/tasks/keystone.py +++ b/qa/tasks/keystone.py @@ -140,7 +140,10 @@ def setup_venv(ctx, config): ]) run_in_keystone_venv(ctx, client, - [ 'pip', 'install', 'python-openstackclient']) + [ 'pip', 'install', + 'python-openstackclient==5.2.1', + 'osc-lib==2.0.0' + ]) try: yield finally: -- 2.39.5