From e27e4e75078fa525953a593ff46644fa69e2cc8a Mon Sep 17 00:00:00 2001 From: "Jesse Pretorius (odyssey4me)" Date: Mon, 18 May 2020 14:58:47 +0100 Subject: [PATCH] Correctly match openvswitch package The current regex will match more than one package if the openvswitchX.YZ-test package is installed. eg: rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/' openvswitch2.11-test-2.11.0-35.el7fdp.noarch openvswitch2.11-2.11.0-35.el7fdp.x86_64 The right package to find has the form: openvswitchA.BC-A.BC.D- So we change the regex to only match if it has that form. rhbz#1826367 Change-Id: I2f9456395b19c26d20917f8ca9183741566635c3 (cherry picked from commit 5b2daa49980bda49231842b4300cd08f4f339f61) --- puppet/services/tripleo-packages.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/puppet/services/tripleo-packages.yaml b/puppet/services/tripleo-packages.yaml index 76578ad8a1..8d9fee2f46 100644 --- a/puppet/services/tripleo-packages.yaml +++ b/puppet/services/tripleo-packages.yaml @@ -134,7 +134,7 @@ outputs: - name: Get current OpenvSwitch package name register: ovs_pkg_out shell: - rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' + rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[-0]+-|openvswitch-2)/{print $1}' - name: Don't update if not present set_fact: run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}" @@ -325,7 +325,7 @@ outputs: - name: Get current OpenvSwitch package name register: ovs_pkg_out shell: - rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-|openvswitch-2)/{print $1}' + rpm -qa | awk -F- '/^(openvswitch[0-9]+\.[0-9]+-[0-9]+\.[0-9]+\.[-0]+-|openvswitch-2)/{print $1}' - name: Don't update if not present set_fact: run_ovs_update: "{{ (ovs_pkg_out.stdout | length) > 0 }}"