From d3607bcb7a1a85e49af986c878903b9592472373 Mon Sep 17 00:00:00 2001 From: Brent Eagles Date: Fri, 17 Jan 2020 10:31:05 -0330 Subject: [PATCH] Bypass openvswitch update logic if expected packages are not present The nuage integration uses a different package name for openvswitch, breaking the update steps. This patch bypasses the update logic if the expected packages are not present allowing nuage deployments to manage the openvswitch package some other other way. Note: Due to path restructuring and file renaming, this is a semantic backport of https://review.opendev.org/#/c/702677/. This patch also includes similar modifications in the update_tasks for layered packaging on queens. Original commit: f907d061ba1d8cf6fbd15fc242b162c618a70154 Change-Id: I282b8b44db5b29b4b9a995b2f2938719ce04a077 Closes-Bug: #1858640 --- puppet/services/tripleo-packages.yaml | 36 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/puppet/services/tripleo-packages.yaml b/puppet/services/tripleo-packages.yaml index 67f323cab2..e2ea7f1657 100644 --- a/puppet/services/tripleo-packages.yaml +++ b/puppet/services/tripleo-packages.yaml @@ -126,8 +126,17 @@ outputs: # change with every major upgrade so this special handling will # eventually replace the special handling of upgrading the # openvswitch package "in place" + - name: Get current OpenvSwitch package name + register: ovs_pkg_out + shell: + rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' + - name: Don't update if not present + set_fact: + run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}" - name: Block for gathering information for upgrading OpenvSwitch layered product packaging - when: step|int == 2 + when: + - step|int == 2 + - run_ovs_update|bool block: - name: Process rhosp-openvswitch layered package for new version number shell: | @@ -142,11 +151,6 @@ outputs: set_fact: new_ovs_version: "{{ rhosp_package_result.stdout }}" when: ovs_lp_packaging|default(false) - - - name: Get current OpenvSwitch package name - register: ovs_pkg_out - shell: - rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' - name: Get version from current OpenvSwitch package register: ovs_version_out shell: @@ -188,7 +192,7 @@ outputs: - name: Check for openvswitch upgrade if not layered package installs when: - step|int == 2 - - run_ovs_update|default(true) + - run_ovs_update|bool block: - name: check if an upgrade is required register: ovs_need_upgrade @@ -228,7 +232,7 @@ outputs: - "{{ovs_list_of_rpms.stdout_lines}}" when: - step|int == 2 - - run_ovs_update|default(true) + - run_ovs_update|bool - ovs_packaging_issue|default(false)|succeeded - ovs_need_upgrade.stdout|default('') # The openvswitch package disables the systemd service on install. When installing @@ -305,8 +309,17 @@ outputs: # change with every major upgrade so this special handling will # eventually replace the special handling of upgrading the # openvswitch package "in place" + - name: Get current OpenvSwitch package name + register: ovs_pkg_out + shell: + rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' + - name: Don't update if not present + set_fact: + run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}" - name: Block for gathering information for upgrading OpenvSwitch layered product packaging - when: step|int == 2 + when: + - step|int == 2 + - run_ovs_update|bool block: - name: Process rhosp-openvswitch layered package for new version number shell: | @@ -321,11 +334,6 @@ outputs: set_fact: new_ovs_version: "{{ rhosp_package_result.stdout }}" when: ovs_lp_packaging|default(false) - - - name: Get current OpenvSwitch package name - register: ovs_pkg_out - shell: - rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' - name: Get version from current OpenvSwitch package register: ovs_version_out shell: