Fix venv build fallback mechanism

Fixes the ability to deploy a venv in cases where:
1) developer_mode is not enabled
2) A cached venv is not downloaded from the repo server

Also introduced is a var that can be used to disable the cached venv
download attempt entirely and force the fallback behavior. Previously
that would have been available by simply setting the venv download
to some broken URL like "http://localhost/none", but
nova_venv_download will allow for much easier disabling of the
cached venv download behavior.

Change-Id: Id41233789047906a0eb5f1af4d0d6b4dde55d8c7
This commit is contained in:
Logan V 2017-01-05 11:04:22 -06:00
parent dae54d61a5
commit ed97bd78f3
4 changed files with 8 additions and 5 deletions

View File

@ -43,6 +43,9 @@ nova_developer_constraints:
nova_venv_tag: untagged
nova_bin: "/openstack/venvs/nova-{{ nova_venv_tag }}/bin"
# venv_download, even when true, will use the fallback method of building the
# venv from scratch if the venv download fails.
nova_venv_download: "{{ not nova_developer_mode | bool }}"
nova_venv_download_url: http://127.0.0.1/venvs/untagged/ubuntu/nova.tgz
nova_fatal_deprecations: False

View File

@ -63,7 +63,7 @@
retries: 5
delay: 2
when:
- nova_get_venv | failed or nova_developer_mode | bool
- not nova_get_venv | success or nova_developer_mode | bool
tags:
- nova-install
- nova-pip-packages

View File

@ -50,7 +50,7 @@
retries: 5
delay: 2
when:
- nova_get_venv | failed or nova_developer_mode | bool
- not nova_get_venv | success or nova_developer_mode | bool
tags:
- nova-install
- nova-pip-packages

View File

@ -169,7 +169,7 @@
dest: "/var/cache/{{ nova_venv_download_url | basename }}"
checksum: "sha1:{{ lookup('url', nova_venv_download_url | replace('tgz', 'checksum')) }}"
register: nova_get_venv
when: not nova_developer_mode | bool
when: nova_venv_download | bool
tags:
- nova-install
- nova-pip-packages
@ -199,7 +199,7 @@
copy: "no"
when:
- not nova_developer_mode | bool
- nova_get_venv | changed or nova_venv_dir | changed
- nova_get_venv | changed
notify: Restart nova services
tags:
- nova-install
@ -219,7 +219,7 @@
until: install_packages|success
retries: 5
delay: 2
when: nova_developer_mode | bool
when: not nova_get_venv | success or nova_developer_mode | bool
notify: Restart nova services
tags:
- nova-install