Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #318: Introducing custom uninstall in sensu_gem #332

Merged
merged 1 commit into from
Mar 20, 2015

Conversation

queeno
Copy link
Contributor

@queeno queeno commented Mar 12, 2015

sensu_gem inherits the methods from its parent, gem.rb.

The uninstall method in gem.rb contains a bug that prevents the right gem command from being issued. /usr/bin/gem uninstall -x -a sensu-plugin is executed instead of /opt/sensu/embedded/bin/gem uninstall -x -a sensu-plugin.

Issue PUP-4191 has been raised in the puppet project and PR #3708 has been opened in puppetlabs/puppet.

As temporary workaround, we should overwrite the gem.rb uninstall method to use the execute function, which then issues the right gem command.

This produces an idempotent puppet run.
Before this fix was applied, puppet was constantly attempting to remove sensu-plugin from the system gem (/usr/bin/gem), producing the following output during every single puppet run:

Notice: Compiled catalog for monitoring.vagrant in environment production in 9.62 seconds
Notice: /Stage[main]/Sensu::Package/Package[sensu-plugin]/ensure: removed
Notice: /Stage[main]/Sensu::Client::Service/Service[sensu-client]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Sensu::Api::Service/Service[sensu-api]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Sensu::Server::Service/Service[sensu-server]: Triggered 'refresh' from 1 events
Notice: Finished catalog run in 39.52 seconds

After applying the fix, a clean puppet run is produced:

Notice: Compiled catalog for monitoring.vagrant in environment production in 9.80 seconds
Notice: Finished catalog run in 29.02 seconds

sensu_gem inherits the methods from its parent, gem.rb.
The uninstall method in gem.rb contains a bug that prevents the right
gem command from being issued. (/usr/bin/gem uninstall -x -a
sensu-plugin is executed instead of /opt/sensu/embedded/bin/gem
uninstall -x -a sensu-plugin).

Issue PUP-4191 has been raised in the puppet project and PR #3708 has
been opened in puppetlabs/puppet.

As temporary workaround, we should overwrite the gem.rb uninstall
method to use the execute function, which then issues the right gem
command.
@jlambert121
Copy link
Contributor

Thanks!

jlambert121 added a commit that referenced this pull request Mar 20, 2015
Fix #318: Introducing custom uninstall in sensu_gem
@jlambert121 jlambert121 merged commit dceeee5 into sensu:master Mar 20, 2015
@queeno queeno deleted the fix_non_idempotent_puppet_run branch March 20, 2015 12:41
@queeno
Copy link
Contributor Author

queeno commented Mar 20, 2015

@jlambert121 no problem 😄
Thanks for merging it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants