Fix #318: Introducing custom uninstall in sensu_gem #332
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:After applying the fix, a clean puppet run is produced: