Allow the developer constraints to be adjusted

In order to do a developer mode that allows installation of packages
from local file, which take precedence over the developer_mode
constraints, we need to allow the order of the constraints to be changed.

This patch adds a "pip_install_developer_constraints" var which is used
to set the developer mode constraints. By default this will leave the
same behaviour but will allow additional constraints to be added, or the
developermode constraints file to be overriden altogether.

Change-Id: I9b639cf11f0197c996f9d87210142e898ad46191
This commit is contained in:
Andy McCrae 2017-05-25 14:05:38 +01:00 committed by Jesse Pretorius (odyssey4me)
parent 8120853dbd
commit b17d8808a5
7 changed files with 17 additions and 7 deletions

View File

@ -42,7 +42,10 @@
state: "{{ nova_pip_package_state }}"
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: >-
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options|default('') }}
register: install_packages
until: install_packages|success
retries: 5

View File

@ -20,7 +20,7 @@
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ nova_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages

View File

@ -61,7 +61,10 @@
state: "{{ nova_pip_package_state }}"
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: >-
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options|default('') }}
register: install_packages
until: install_packages|success
retries: 5

View File

@ -20,7 +20,7 @@
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ nova_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages

View File

@ -19,7 +19,10 @@
state: "{{ nova_pip_package_state }}"
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: "{{ pip_install_options|default('') }}"
extra_args: >-
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options|default('') }}
register: install_packages
until: install_packages|success
retries: 5

View File

@ -48,6 +48,7 @@
name: "{{ nova_requires_pip_packages }}"
state: "{{ nova_pip_package_state }}"
extra_args: >-
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages
@ -115,7 +116,7 @@
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ nova_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages

View File

@ -20,7 +20,7 @@
virtualenv: "{{ nova_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ nova_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ nova_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ (pip_install_upper_constraints is defined) | ternary('--constraint ' + pip_install_upper_constraints | default(''),'') }}
{{ pip_install_options | default('') }}
register: install_packages