Bug #17134

puppet-agent-oauth release upgrade uninstalls gem

Added by Dominic Cleal 4 months ago. Updated 3 months ago.

Status:Closed
Priority:Normal
Assigned To:Dominic Cleal
Category:RPMs
Target version:-
Difficulty: Bugzilla link:
Found in release:1.13.1 Pull request:https://github.com/theforeman/foreman-packaging/pull/1400
Story points-
Velocity based estimate-
Release1.13.2Release relationshipAuto

Description

On upgrade from puppet-agent-oauth 0.5.1-1 to -2, the gem is uninstalled from the AIO environment:

# rpm -ivh http://yum.theforeman.org/releases/1.13/el7/x86_64/puppet-agent-oauth-0.5.1-1.el7.noarch.rpm
Retrieving http://yum.theforeman.org/releases/1.13/el7/x86_64/puppet-agent-oauth-0.5.1-1.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.BXsAvf: Header V4 RSA/SHA256 Signature, key ID 7dfe6fc2: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:puppet-agent-oauth-0.5.1-1.el7   ################################# [100%]
# /opt/puppetlabs/puppet/bin/gem list -a oauth

*** LOCAL GEMS ***

oauth (0.5.1)
# rpm -Uvh http://yum.theforeman.org/releases/1.13/el7/x86_64/puppet-agent-oauth-0.5.1-2.el7.noarch.rpm
Retrieving http://yum.theforeman.org/releases/1.13/el7/x86_64/puppet-agent-oauth-0.5.1-2.el7.noarch.rpm
warning: /var/tmp/rpm-tmp.xH9pS3: Header V4 RSA/SHA256 Signature, key ID 7dfe6fc2: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:puppet-agent-oauth-0.5.1-2.el7   ################################# [ 50%]
Cleaning up / removing...
   2:puppet-agent-oauth-0.5.1-1.el7   ################################# [100%]
# /opt/puppetlabs/puppet/bin/gem list -a oauth

*** LOCAL GEMS ***

This is due to the preun being run on the old package after the installation of the new, causing uninstallation of the gem. When the release (not version) is incremented, the gem shouldn't be uninstalled by the old package as both packages install the same version.

Associated revisions

Revision e121ea49
Added by Dominic Cleal 3 months ago

fixes #17134 - fix release bump upgrade to keep gem installed

The package preun ran after the post scriptlet, which when the release
and not version was updated, caused the gem to be uninstalled as both
the old and new packages managed the same version.

The gem is now only uninstalled in preun if there are multiple versions
installed (i.e. a second version from the new package). A workaround was
added for the current version 0.5.1 to restore the gem on upgrade.

History

#1 Updated by The Foreman Bot 4 months ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-packaging/pull/1400 added

#2 Updated by Dominic Cleal 3 months ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF