-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-4237) Add puppet-agent gem provider #3777
(PUP-4237) Add puppet-agent gem provider #3777
Conversation
The gem uninstall flags (-x, -a) used in the gem.rb uninstall method do not inform the user about their behaviour. This commit expands their names for readibility purposes. Conflicts: lib/puppet/provider/package/gem.rb
The gem_spec unit test does not allow tests for scenarios other than installing gems. This commit segregates the tests in an rspec context in order to tests for gem removal.
No unit tests are in place to check the uninstall behaviour of the gem provider. This commit adds unit tests to verify the gem.rb uninstall method functionality.
A user cannot pass extra flags to the gem provider in order to uninstall ruby gems. The uninstall method in the gem provider now consumes the uninstall_options attribute of the package resource, which may be used to specify extra flags to uninstall ruby gems.
The newly introduced uninstall_option functionality in the gem provider uninstall method is untested. Unit tests have been added in order to test this new functionality.
@joshcooper on the original PR you had asked about windows support. What is needed to make that happen? |
Trivially it's "add another provider", but that really stinks. (having Is there an existing way of handling this sort of situation? |
CLA signed by all contributors. |
On windows Puppet's ruby is at the start of the path, so we don't need to try to figure it out and hard-code it. We simply use the standard command lookup.
I still need to verify proper functioning on windows, just pushed up the code to my working branch |
👍 This looks like it should work. |
@branan Let me know when you've verified on Windows. |
@MikaelSmith looks like it works. Windows firewall blocked Gem from the network, but that's a different problem that I'll talk to either RE or the windows team about. |
(PUP-4237) Add puppet-agent gem provider
* upstream/stable: (26 commits) (packaging) Update PUPPETVERSION to 4.0.0 (maint) Pin to a released beaker version (PUP-4237) Use provider name in Gem provider self.instances (PUP-4237) Support windows in the puppet_gem provider (PUP-4237) Add uninstall_options support to puppet_gem (PUP-4237) Add puppet_gem provider for installing puppet-agent gems (PUP-4203) Add unit tests for gem.rb uninstall_options (PUP-4203) Introduce uninstall options in the gem provider (PUP-4191) Add unit tests for the uninstall method in gem.rb (PUP-4191) Segregate the gem_spec tests in an rspec context (PUP-4355) Update windows tests for ~/.puppetlabs Revert "Merge pull request #3777 from branan/pup-4237/add_agent_gem_provider" (maint) Re-apply Ruby 1.9 fix from Facter (PUP-4330) Use Emit.dump rather than to_plist (PUP-4355) Update per-user directories to AIO paths (PUP-4237) Support windows in the puppet_gem provider (PUP-4237) Add uninstall_options support to puppet_gem (PUP-4237) Add puppet_gem provider for installing puppet-agent gems (PUP-4203) Add unit tests for gem.rb uninstall_options (PUP-4203) Introduce uninstall options in the gem provider ...
Is there any chance of also getting this functionality in a 3.x release? |
@jhoblitt puppet 3.x doesn't have the same packages that bundle ruby, so the straight gem provider should work. |
@kylog I wonder if @jhoblitt is specifically interested in the uninstall_options that was introduced to the gem provider at branan@70a7e28 |
This is a rebase of #3728 against the stable branch so it can be included in Puppet 4.0
It includes cherry-picks of PUP-4191 and PUP-4203 (from #3708), since this code was originally written assuming they would be merged into 4.0 but they ended up in 4.1