openstack minor update - list_updates=$(yum list updates) never returns empty string

Bug #1680634 reported by Andreas Karis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Matthew Flusche

Bug Description

Description of problem:
openstack minor update - list_updates=$(yum list updates) never returns empty string

/usr/share/openstack-tripleo-heat-templates/extraconfig/tasks/yum_update.sh
~~~
(...)
list_updates=$(yum list updates)

if [[ "$list_updates" == "" ]]; then
    echo "No packages require updating"
    exit 0
fi
(...)
~~~

The if condition never fulfills!

This can be easily tested:
~~~
[root@undercloud-4 ~]# list_updates=$(yum list updates)
[root@undercloud-4 ~]# echo $list_updates
Loaded plugins: search-disabled-repos
~~~

Expected results:
This should be `yum -q list updates`, and the if condition will be reached

Additional info:

As a side note, related to this:

We fix the pacemaker timeouts, but **after** the if condition which leads to an exit. Only **then* do we increase the timeouts on pacemaker resources, but **never** (at least not in this script) are we setting them back. If this is a global workaround, this will work now, because the if condition is never true. If the increased timeouts are needed elsewhere in the update process, though, then they need to be before the if condition, or the timeouts will not be adjusted if the above bug is fixed.
~~~
# Fix the redis/rabbit resource start/stop timeouts. See https://bugs.launchpad.net/tripleo/+bug/1633455
# and https://bugs.launchpad.net/tripleo/+bug/1634851
if [[ "$pacemaker_status" == "active" && \
      "$(hiera -c /etc/puppet/hiera.yaml bootstrap_nodeid)" = "$(facter hostname)" ]] ; then
    if pcs resource show rabbitmq | grep -E "start.*timeout=100"; then
        pcs resource update rabbitmq op start timeout=200s
    fi
    if pcs resource show rabbitmq | grep -E "stop.*timeout=90"; then
        pcs resource update rabbitmq op stop timeout=200s
    fi
    if pcs resource show redis | grep -E "start.*timeout=120"; then
        pcs resource update redis op start timeout=200s
    fi
    if pcs resource show redis | grep -E "stop.*timeout=120"; then
        pcs resource update redis op stop timeout=200s
    fi
fi
~~~

https://github.com/openstack/tripleo-heat-templates/blob/master/extraconfig/tasks/yum_update.sh

Revision history for this message
Alex Schultz (alex-schultz) wrote :

It should be noted that the timeouts are correct. I believe this was added as a workaround to bring them up to match what was expected in the puppet in later versions.

https://github.com/openstack/puppet-tripleo/blob/master/manifests/profile/pacemaker/rabbitmq.pp#L101

Changed in tripleo:
status: New → Triaged
importance: Undecided → Medium
milestone: none → pike-2
assignee: nobody → Alex Schultz (alex-schultz)
tags: added: idempotency
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (master)

Fix proposed to branch: master
Review: https://review.openstack.org/454735

Changed in tripleo:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tripleo-heat-templates (master)

Change abandoned by Alex Schultz (<email address hidden>) on branch: master
Review: https://review.openstack.org/454735
Reason: https://review.openstack.org/#/c/438730

Changed in tripleo:
assignee: Alex Schultz (alex-schultz) → Matthew Flusche (mflusche)
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/456358

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tripleo-heat-templates (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/456359

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/ocata)

Reviewed: https://review.openstack.org/456358
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=037d09a07602f5a93e2104c9c17f668a3dcd0c3c
Submitter: Jenkins
Branch: stable/ocata

commit 037d09a07602f5a93e2104c9c17f668a3dcd0c3c
Author: Matthew Flusche <email address hidden>
Date: Mon Feb 27 22:11:37 2017 +0000

    yum_update.sh - Use the yum parameter: check-update

    The current check tends to produce a false positive causing unnecessary
    service restarts. yum check-update will exit with return code 100 if
    updated packages are available.

    Change-Id: I8bd89f2b24bafc6c991382b9eb484cfa9a2f8968
    (cherry picked from commit 9e4375d2762f4a26e8b0b8375f9265ad6e439ea1)
    Closes-Bug: #1680634

tags: added: in-stable-ocata
tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to tripleo-heat-templates (stable/newton)

Reviewed: https://review.openstack.org/456359
Committed: https://git.openstack.org/cgit/openstack/tripleo-heat-templates/commit/?id=b9a781fd2b118844e1efa2f9896c74f9e99a7908
Submitter: Jenkins
Branch: stable/newton

commit b9a781fd2b118844e1efa2f9896c74f9e99a7908
Author: Matthew Flusche <email address hidden>
Date: Mon Feb 27 22:11:37 2017 +0000

    yum_update.sh - Use the yum parameter: check-update

    The current check tends to produce a false positive causing unnecessary
    service restarts. yum check-update will exit with return code 100 if
    updated packages are available.

    Change-Id: I8bd89f2b24bafc6c991382b9eb484cfa9a2f8968
    (cherry picked from commit 9e4375d2762f4a26e8b0b8375f9265ad6e439ea1)
    Closes-Bug: #1680634

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 5.3.0

This issue was fixed in the openstack/tripleo-heat-templates 5.3.0 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/tripleo-heat-templates 6.1.0

This issue was fixed in the openstack/tripleo-heat-templates 6.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.