Skip to content

Commit 630f8e0

Browse files
authored
Merge pull request ceph#59241 from tobias-urdin/openstack-upperconstraints
qa: barbican: restrict python packages with upper-constraints Reviewed-by: Casey Bodley <[email protected]>
2 parents 959a4c3 + bbcb820 commit 630f8e0

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

qa/tasks/barbican.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,20 +88,29 @@ def run_in_barbican_venv(ctx, client, args):
8888
run.Raw('&&')
8989
] + args)
9090

91+
def get_constraints_url(cconf):
92+
version = cconf.get('force-branch', 'master')
93+
if '/' in version:
94+
# split stable/<version> to <version>
95+
version = str(version).split('/')[1]
96+
url = f"https://releases.openstack.org/constraints/upper/{version}"
97+
return url
98+
9199
@contextlib.contextmanager
92100
def setup_venv(ctx, config):
93101
"""
94102
Setup the virtualenv for Barbican using pip.
95103
"""
96104
assert isinstance(config, dict)
97105
log.info('Setting up virtualenv for barbican...')
98-
for (client, _) in config.items():
106+
for (client, cconf) in config.items():
99107
run_in_barbican_dir(ctx, client,
100108
['python3', '-m', 'venv', '.barbicanenv'])
101109
run_in_barbican_venv(ctx, client,
102110
['pip', 'install', '--upgrade', 'pip'])
111+
url = get_constraints_url(cconf)
103112
run_in_barbican_venv(ctx, client,
104-
['pip', 'install', 'pytz',
113+
['pip', 'install', f'-c{url}', 'pytz',
105114
'-e', get_barbican_dir(ctx)])
106115
yield
107116

0 commit comments

Comments
 (0)