[instack-undercloud] puppet-stack-config.pp $pkg_upgrade_cmd default will always fail

Bug #1639868 reported by John Trowbridge
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tripleo
Fix Released
Medium
Alex Schultz

Bug Description

Our default for $pkg_upgrade_cmd will cause a failure for any non-RedHat osfamily. While it is pretty likely that we have other places in TripleO that break for non-rpm distros, I think it is still worth fixing this up.

Further details from Alex Shultz in https://review.openstack.org/#/c/391473/2/elements/puppet-stack-config/puppet-stack-config.pp :

"""
  case $::osfamily {
    'RedHat': {
      $pkg_upgrade_cmd = 'yum -y update'
    }
    default: {
      warning('Please specify a package upgrade command for distribution.')
"""

This should either be a fail or we need to specify $pkg_upgrade_cmd = 'true' or something because the exec below will just error if $pkg_upgrade_cmd is undef.

[root@host ~]# cat t.pp
exec { 'test':
  command => $undef_variable,
  path => '/usr/bin',
  timeout => 0
}
[root@host ~]# puppet apply t.pp
Notice: Compiled catalog for packstack in environment production in 0.08 seconds
Error: test returned 1 instead of one of [0]
Error: /Stage[main]/Main/Exec[test]/returns: change from notrun to 0 failed: test returned 1 instead of one of [0]
Notice: Finished catalog run in 0.53 seconds

Revision history for this message
John Trowbridge (trown) wrote :

I like the idea of setting $pkg_upgrade_cmd = 'true' combined with making the warning a bit more clear on how someone would add update support for their distro.

I tried adding low-hanging-fruit tag... but launchpad is not cooperating.

tags: added: low-hanging-fruit
Revision history for this message
John Trowbridge (trown) wrote :

hmm... apparently needed a comment on the bug first?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to instack-undercloud (master)

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

Changed in tripleo:
assignee: nobody → Alex Schultz (alex-schultz)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to instack-undercloud (master)

Reviewed: https://review.openstack.org/400956
Committed: https://git.openstack.org/cgit/openstack/instack-undercloud/commit/?id=0a316cb503f4be8b80e194ced4b285b4767d6ec4
Submitter: Jenkins
Branch: master

commit 0a316cb503f4be8b80e194ced4b285b4767d6ec4
Author: Alex Schultz <email address hidden>
Date: Tue Nov 22 13:40:42 2016 -0700

    Fix package update cases

    This change addresses two issues with the existing
    puppet-stack-config. The first being if run on a non-RedHat osfamily,
    the existing code will fail with a non-helpful message. The second issue
    being that if update_packages is disabled, the resource dependency will
    fail because Exec['package-upgrade] is not defined.

    Change-Id: I682167d10828280a031f6f84c1de11b9bd840db5
    Closes-Bug: #1639868

Changed in tripleo:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/instack-undercloud 6.0.0.0b2

This issue was fixed in the openstack/instack-undercloud 6.0.0.0b2 development milestone.

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.