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

(PUP-4237) Add puppet-agent gem provider #3777

Merged

Conversation

branan
Copy link
Contributor

@branan branan commented Mar 31, 2015

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

queeno and others added 7 commits March 31, 2015 09:08
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.
@branan
Copy link
Contributor Author

branan commented Mar 31, 2015

To be more specific, I cherry-picked the fixed up versions of the #3708 commits that @melissa merged into master.

@branan
Copy link
Contributor Author

branan commented Mar 31, 2015

@joshcooper on the original PR you had asked about windows support. What is needed to make that happen?

@branan
Copy link
Contributor Author

branan commented Mar 31, 2015

Trivially it's "add another provider", but that really stinks. (having puppet_gem_win in addition to this one). I'm not aware of a way to declare a command is used/needed based on a fact. We could flag both the windows and linux commands as optional and implement the failure logic ourselves if neither is found, but that also feels kinda hacky to me :/

Is there an existing way of handling this sort of situation?

@puppetcla
Copy link

CLA signed by all contributors.

@HAIL9000 HAIL9000 added the PL label Mar 31, 2015
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.
@branan
Copy link
Contributor Author

branan commented Mar 31, 2015

I still need to verify proper functioning on windows, just pushed up the code to my working branch

@MikaelSmith
Copy link
Contributor

👍 This looks like it should work.

@MikaelSmith
Copy link
Contributor

@branan Let me know when you've verified on Windows.

@branan
Copy link
Contributor Author

branan commented Mar 31, 2015

@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.

MikaelSmith pushed a commit that referenced this pull request Apr 1, 2015
@MikaelSmith MikaelSmith merged commit 2fde2c0 into puppetlabs:stable Apr 1, 2015
joshcooper added a commit to joshcooper/puppet that referenced this pull request Apr 1, 2015
…gent_gem_provider"

This reverts commit 2fde2c0, reversing
changes made to 474cabb.
joshcooper added a commit that referenced this pull request Apr 13, 2015
* 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
  ...
@jhoblitt
Copy link
Contributor

Is there any chance of also getting this functionality in a 3.x release?

@kylog
Copy link

kylog commented Apr 21, 2015

@jhoblitt puppet 3.x doesn't have the same packages that bundle ruby, so the straight gem provider should work.

@ferventcoder
Copy link
Contributor

@kylog I wonder if @jhoblitt is specifically interested in the uninstall_options that was introduced to the gem provider at branan@70a7e28

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.

None yet

8 participants