From ffcdc13ea0b1d47f3421eea51f883c21392c3702 Mon Sep 17 00:00:00 2001 From: Andy McCrae Date: Fri, 26 May 2017 11:50:20 +0100 Subject: [PATCH] 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: I64dccbdc387b7428f0cb95b5bd81c588a11bcc37 --- tasks/neutron_install.yml | 5 +++-- tasks/providers/calico_config.yml | 2 +- tasks/providers/dragonflow_config.yml | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index 886bc453..357fec09 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -44,6 +44,7 @@ name: "{{ neutron_requires_pip_packages }}" state: "{{ neutron_pip_package_state }}" extra_args: >- + {{ neutron_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 @@ -93,7 +94,7 @@ virtualenv: "{{ neutron_bin | dirname }}" virtualenv_site_packages: "no" extra_args: >- - {{ neutron_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }} + {{ neutron_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 @@ -127,7 +128,7 @@ virtualenv: "{{ neutron_bin | dirname }}" virtualenv_site_packages: "no" extra_args: >- - {{ neutron_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }} + {{ neutron_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('') }} when: neutron_bgp | bool or diff --git a/tasks/providers/calico_config.yml b/tasks/providers/calico_config.yml index 6961f087..f0ea0a31 100644 --- a/tasks/providers/calico_config.yml +++ b/tasks/providers/calico_config.yml @@ -20,7 +20,7 @@ virtualenv: "{{ neutron_bin | dirname }}" virtualenv_site_packages: "no" extra_args: >- - {{ neutron_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }} + {{ neutron_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 diff --git a/tasks/providers/dragonflow_config.yml b/tasks/providers/dragonflow_config.yml index 5faff31c..68e4fa99 100644 --- a/tasks/providers/dragonflow_config.yml +++ b/tasks/providers/dragonflow_config.yml @@ -20,7 +20,7 @@ virtualenv: "{{ neutron_bin | dirname }}" virtualenv_site_packages: "no" extra_args: >- - {{ neutron_developer_mode | ternary('--constraint /opt/developer-pip-constraints.txt', '') }} + {{ neutron_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