Skip to content

Commit fd957cc

Browse files
committed
fix(reproducer): Use controller-0 path when installing requirements
Previously, the check for `common-requirements.txt` would check if common requirements exists on localhost at a given path. This path is based on the home directory on localhost. If the file did exist, it would use that same path to try to install the requirements on controller-0. This causes issues when localhost and controller-0 do not have the same users and home directories.
1 parent ad3ab80 commit fd957cc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

roles/reproducer/tasks/configure_controller.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -357,11 +357,10 @@
357357
- cifmw_reproducer_src_dir_stat.stat.exists
358358
- cifmw_reproducer_src_dir_stat.stat.isdir
359359

360-
- name: Check if local common-requirements.txt exists
361-
delegate_to: localhost
360+
- name: Check if common-requirements.txt exists on controller-0
362361
ansible.builtin.stat:
363-
path: "{{ cifmw_project_dir_absolute }}/common-requirements.txt"
364-
register: _local_common_requirements_check
362+
path: "{{ cifmw_reproducer_controller_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/common-requirements.txt"
363+
register: _controller_common_requirements_check
365364
run_once: true
366365
ignore_errors: true
367366

@@ -370,10 +369,10 @@
370369
async: 600 # 10 minutes should be more than enough
371370
poll: 0
372371
ansible.builtin.pip:
373-
requirements: "{{ have_local | ternary(local, remote) }}"
372+
requirements: "{{ have_controller_reqs | ternary(controller_reqs, remote) }}"
374373
vars:
375-
have_local: "{{ _local_common_requirements_check.stat is defined and _local_common_requirements_check.stat.exists }}"
376-
local: "{{ cifmw_project_dir_absolute }}/common-requirements.txt"
374+
have_controller_reqs: "{{ _controller_common_requirements_check.stat is defined and _controller_common_requirements_check.stat.exists }}"
375+
controller_reqs: "{{ cifmw_reproducer_controller_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework/common-requirements.txt"
377376
remote: https://raw.githubusercontent.com/openstack-k8s-operators/ci-framework/main/common-requirements.txt
378377

379378
- name: Inject most of the cifmw_ parameters passed to the reproducer run

0 commit comments

Comments
 (0)