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: I43a36ee0d887501c9e91bf27f975e4465dcd5d52
This commit is contained in:
Andy McCrae 2017-05-26 10:53:09 +01:00
parent 54865e7a18
commit ed8e52b820
2 changed files with 5 additions and 1 deletions

View File

@ -38,6 +38,7 @@
name: "{{ barbican_requires_pip_packages }}"
state: "{{ barbican_pip_package_state }}"
extra_args: >-
{{ barbican_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
@ -88,7 +89,7 @@
virtualenv: "{{ barbican_bin | dirname }}"
virtualenv_site_packages: "no"
extra_args: >-
{{ barbican_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }}
{{ barbican_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

@ -25,6 +25,9 @@
pip:
name: "{{ item }}"
state: present
extra_args: >-
{{ barbican_developer_mode | ternary(pip_install_developer_constraints | default('--constraint /opt/developer-pip-constraints.txt'), '') }}
{{ pip_install_options | default('') }}
with_items:
- httplib2
- python-barbicanclient