Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.

Commit

Permalink
Fixes #15277 - use yum erase instead of rpm -e. (#354)
Browse files Browse the repository at this point in the history
The gutterball removal requests the removal of a handful of packages.
If any are missing with `rpm -e`, the entire command will fail.
However, if you use `yum erase`, the missing packages will not cause an
issue and the remaining packages will be removed. Additionally, `yum
erase` will return a zero exit code in this case.

Logic was also added to cover both the `tomcat` and `tomcat6` dirs
during cleanup.
  • Loading branch information
beav authored and ehelms committed Jun 3, 2016
1 parent af52c83 commit dd69db6
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions hooks/post/30-upgrade.rb
Expand Up @@ -42,8 +42,12 @@ def remove_docker_v1_content

def remove_gutterball
return true unless Kafo::Helpers.execute('rpm -q gutterball')
Kafo::Helpers.execute("rpm -e gutterball tfm-rubygem-foreman_gutterball gutterball-certs tfm-rubygem-hammer_cli_gutterball")
Kafo::Helpers.execute("rmdir /var/lib/tomcat/webapps/gutterball")
Kafo::Helpers.execute("yum erase -y gutterball tfm-rubygem-foreman_gutterball gutterball-certs tfm-rubygem-hammer_cli_gutterball")

['tomcat', 'tomcat6'].each do |t|
gutterball_dir = "/var/lib/#{t}/webapps/gutterball"
Kafo::Helpers.execute("rmdir #{gutterball_dir}") if File.directory?(gutterball_dir)
end
end

def upgrade_step(step, options = {})
Expand Down

0 comments on commit dd69db6

Please sign in to comment.