From 111c1d945ac374a505206e79313f2d61d8d74d23 Mon Sep 17 00:00:00 2001 From: Jimmy McCrory Date: Mon, 14 Mar 2016 10:18:16 -0700 Subject: [PATCH] Use upper-constraints file in developer mode Last week, keystone was failing to install in developer mode due to us not specifying upper constraints. This was due to an upcapped version of pysaml2 being installed which is causing problems. This commit first clones the requirements repo and then uses the upper constraints file when installing packages. Note that we only update pip_install_options when in developer mode if the constraints aren't already set. This is because in developer mode you could have a container with multiple services running on it and the pip_install_options fact would get updated when already set, resulting in pip failing to install packages. Change-Id: Iadb01964d2a23ab6457862545eaea5fed77678a5 Partial-Bug: #1553970 --- defaults/main.yml | 3 +++ tasks/neutron_install.yml | 21 ++++++++++++++++++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 41bba9b2..b73afe4d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -35,6 +35,9 @@ neutron_lbaas_git_install_branch: master neutron_vpnaas_git_repo: https://git.openstack.org/openstack/neutron-vpnaas neutron_vpnaas_git_install_branch: master +neutron_requirements_git_repo: https://git.openstack.org/openstack/requirements +neutron_requirements_git_install_branch: "{{ requirements_git_install_branch | default(master) }}" + neutron_developer_mode: false neutron_developer_constraints: - "git+{{ neutron_git_repo }}@{{ neutron_git_install_branch }}#egg=neutron" diff --git a/tasks/neutron_install.yml b/tasks/neutron_install.yml index beac8d81..1b6e485b 100644 --- a/tasks/neutron_install.yml +++ b/tasks/neutron_install.yml @@ -85,15 +85,30 @@ - neutron-install - neutron-pip-packages -- name: Set constraint file fact for developer mode - set_fact: - pip_install_options: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt" +- name: Clone requirements git repository + git: + repo: "{{ neutron_requirements_git_repo }}" + dest: "/opt/requirements" + clone: yes + update: yes + version: "{{ neutron_requirements_git_install_branch }}" when: - neutron_developer_mode | bool tags: - neutron-install - neutron-pip-packages +- name: Add constraints to pip_install_options fact for developer mode + set_fact: + pip_install_options: "{{ pip_install_options|default('') }} --constraint /opt/developer-pip-constraints.txt --constraint /opt/requirements/upper-constraints.txt" + when: + - neutron_developer_mode | bool + - "'/opt/developer-pip-constraints.txt' not in pip_install_options|default('')" + - "'/opt/requirements/upper-constraints.txt' not in pip_install_options|default('')" + tags: + - neutron-install + - neutron-pip-packages + - name: Install requires pip packages pip: name: "{{ item }}"