From 4c2b4b81bdf700919e41e0b7750172924d1a2012 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 4 May 2016 10:41:20 +0100 Subject: [PATCH] Change pip install task state to 'latest' Currently all pip install tasks only require the package to be present. This means that when an environment undergoes a minor upgrade the package is not upgraded to the same version that was tested with. This ultimately results in a deployed environment that does not match the tested environment. While for the services installed into venvs this is not an issue, it does affect those which do not use venvs and any packages which are installed outside of a venv or on top of a venv. This patch changes the behaviour to ensure that the install task will always use the latest available package. In developer_mode this will mean using the version specified in upper-constraints, and in an integrated build this will mean the version which is available in the wheel repo's folder for the tag. Change-Id: I1d6f0123b81a0cfc20a6d30c1a87d1f861a473a7 --- tasks/nova_compute_kvm_install.yml | 4 ++-- tasks/nova_console_novnc_install.yml | 4 ++-- tasks/nova_install.yml | 6 +++--- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tasks/nova_compute_kvm_install.yml b/tasks/nova_compute_kvm_install.yml index b8fc1556..b751580b 100644 --- a/tasks/nova_compute_kvm_install.yml +++ b/tasks/nova_compute_kvm_install.yml @@ -48,7 +48,7 @@ - name: Install pip packages (venv) pip: name: "{{ item }}" - state: present + state: latest virtualenv: "{{ nova_venv_bin | dirname }}" virtualenv_site_packages: "no" extra_args: "{{ pip_install_options|default('') }}" @@ -86,7 +86,7 @@ - name: Install pip packages (no venv) pip: name: "{{ item }}" - state: present + state: latest extra_args: "{{ pip_install_options|default('') }}" register: install_packages until: install_packages|success diff --git a/tasks/nova_console_novnc_install.yml b/tasks/nova_console_novnc_install.yml index 5b3f419d..0c2fbd25 100644 --- a/tasks/nova_console_novnc_install.yml +++ b/tasks/nova_console_novnc_install.yml @@ -64,7 +64,7 @@ - name: Install pip packages (venv) pip: name: "{{ item }}" - state: present + state: latest virtualenv: "{{ nova_venv_bin | dirname }}" virtualenv_site_packages: "no" extra_args: "{{ pip_install_options|default('') }}" @@ -83,7 +83,7 @@ - name: Install pip packages (no venv) pip: name: "{{ item }}" - state: present + state: latest extra_args: "{{ pip_install_options|default('') }}" register: install_packages until: install_packages|success diff --git a/tasks/nova_install.yml b/tasks/nova_install.yml index f375f70d..51c7c2ed 100644 --- a/tasks/nova_install.yml +++ b/tasks/nova_install.yml @@ -90,7 +90,7 @@ - name: Install requires pip packages pip: name: "{{ item }}" - state: present + state: latest extra_args: "{{ pip_install_options_fact }}" register: install_packages until: install_packages|success @@ -205,7 +205,7 @@ - name: Install pip packages (venv) pip: name: "{{ item }}" - state: present + state: latest virtualenv: "{{ nova_venv_bin | dirname }}" virtualenv_site_packages: "no" extra_args: "{{ pip_install_options_fact }}" @@ -225,7 +225,7 @@ - name: Install pip packages (no venv) pip: name: "{{ item }}" - state: present + state: latest extra_args: "{{ pip_install_options_fact }}" register: install_packages until: install_packages|success