Ensure PATH contains the virtual environment when validating CLI
Change-Id: I1c3f195636bb63cad19638c32631d2b753c7ea40
This commit is contained in:
parent
2e4d851272
commit
e6ff691208
@ -18,6 +18,10 @@ ironic_inspector_api_url: "{{ api_protocol }}://{{ internal_ip }}:5050"
|
|||||||
|
|
||||||
# Ensure that Ansible is using python interpreter and dependencies inside the bifrost virtual environment
|
# Ensure that Ansible is using python interpreter and dependencies inside the bifrost virtual environment
|
||||||
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
|
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
|
||||||
|
bifrost_venv_env:
|
||||||
|
VIRTUAL_ENV: "{{ bifrost_venv_dir }}"
|
||||||
|
PATH: "{{ bifrost_venv_dir }}/bin:{{ ansible_env.PATH }}" # include regular path via lookup env
|
||||||
|
pydoc: "python -m pydoc"
|
||||||
ansible_python_interpreter: "{{ bifrost_venv_dir + '/bin/python3' }}"
|
ansible_python_interpreter: "{{ bifrost_venv_dir + '/bin/python3' }}"
|
||||||
|
|
||||||
enable_keystone: false
|
enable_keystone: false
|
||||||
|
@ -18,19 +18,16 @@
|
|||||||
- block:
|
- block:
|
||||||
- name: "List bare metal nodes using CLI and clouds.yaml"
|
- name: "List bare metal nodes using CLI and clouds.yaml"
|
||||||
command: baremetal --debug node list
|
command: baremetal --debug node list
|
||||||
environment:
|
environment: "{{ bifrost_venv_env | combine({'OS_CLOUD': testing_cloud_name }) }}"
|
||||||
OS_CLOUD: "{{ testing_cloud_name }}"
|
|
||||||
|
|
||||||
- name: "List introspection rules using CLI and clouds.yaml"
|
- name: "List introspection rules using CLI and clouds.yaml"
|
||||||
command: baremetal --debug introspection rule list
|
command: baremetal --debug introspection rule list
|
||||||
environment:
|
environment: "{{ bifrost_venv_env | combine({'OS_CLOUD': testing_cloud_name }) }}"
|
||||||
OS_CLOUD: "{{ testing_cloud_name }}"
|
|
||||||
when: enable_inspector | bool
|
when: enable_inspector | bool
|
||||||
|
|
||||||
- name: "List services using CLI and clouds.yaml"
|
- name: "List services using CLI and clouds.yaml"
|
||||||
command: openstack --debug service list
|
command: openstack --debug service list
|
||||||
environment:
|
environment: "{{ bifrost_venv_env | combine({'OS_CLOUD': 'bifrost-admin' }) }}"
|
||||||
OS_CLOUD: bifrost-admin
|
|
||||||
when:
|
when:
|
||||||
- enable_keystone | bool
|
- enable_keystone | bool
|
||||||
- "'bifrost-admin' in clouds"
|
- "'bifrost-admin' in clouds"
|
||||||
@ -42,6 +39,7 @@
|
|||||||
baremetal --debug node list
|
baremetal --debug node list
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
environment: "{{ bifrost_venv_env }}"
|
||||||
|
|
||||||
# FIXME(dtantsur): openrc provides no overrides for ironic-inspector, so we
|
# FIXME(dtantsur): openrc provides no overrides for ironic-inspector, so we
|
||||||
# cannot test it.
|
# cannot test it.
|
||||||
@ -53,6 +51,7 @@
|
|||||||
openstack --debug service list
|
openstack --debug service list
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
environment: "{{ bifrost_venv_env }}"
|
||||||
when:
|
when:
|
||||||
- enable_keystone | bool
|
- enable_keystone | bool
|
||||||
- "'bifrost-admin' in clouds"
|
- "'bifrost-admin' in clouds"
|
||||||
|
5
releasenotes/notes/validate-path-5c303903900dcd65.yaml
Normal file
5
releasenotes/notes/validate-path-5c303903900dcd65.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Fixes ``PATH`` to always include the virtual environment when running
|
||||||
|
validations.
|
Loading…
x
Reference in New Issue
Block a user