-
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-10319) Invalidate rubygems cache after uninstalling puppet_gem package #8009
Conversation
Can one of the admins verify this patch? |
8ff46de
to
f38a659
Compare
CLA signed by all contributors. |
jenkins please test this |
it 'should invalidate the rubygems cache' do | ||
@gem_source = double('gem_source') | ||
allow(Puppet::Util::Autoload).to receive(:gem_source).and_return(@gem_source) | ||
expect(described_class).to receive(:execute_gem_command).with(provider_gem_cmd, %w{uninstall --executables --all myresource}).and_return('') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this expect is needed as it is alos tested on :61
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without this line, builds were failing with Provider puppet_gem package command 'gem' does not exist on this host
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sorry i didn't see that this line is also returning something
It is ok like this 👍
My update isn't passing in CI (but still works for me locally). Sorry for the noise whilst I try to figure out which change broke it. |
…ackage Without this patch after a gem is uninstalled from puppet's ruby environment using the `puppet_gem` `package` provider other actions in an agent's run fail. For instance, modifying a file fails whilst trying to back it up. eg. ``` Error: Could not back up /some/file: pid: 21277 nil spec! included in [#<Gem::StubSpecifi... --- SNIP (massive array ommitted) --- ] /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/specification.rb:743:in `_all' /opt/puppetlabs/puppet/lib/ruby/2.5.0/rubygems/specification.rb:1153:in `latest_specs' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/rubygems.rb:44:in `directories' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:142:in `gem_directories' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:172:in `search_directories' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:98:in `get_file' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:62:in `load_file' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/autoload.rb:201:in `load' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/instance_loader.rb:51:in `loaded_instance' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/terminus.rb:112:in `terminus_class' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:366:in `make_terminus' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:140:in `terminus' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/file_bucket_file/selector.rb:16:in `get_terminus' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/file_bucket_file/selector.rb:20:in `head' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/indirector/indirection.rb:260:in `head' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/file_bucket/dipper.rb:48:in `backup' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/backups.rb:82:in `backup_file_with_filebucket' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/backups.rb:28:in `perform_backup_with_bucket' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/util/backups.rb:15:in `perform_backup' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file.rb:1024:in `backup_existing' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file.rb:761:in `remove_existing' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file.rb:888:in `write' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file/data_sync.rb:93:in `contents_sync' /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/puppet/type/file/content.rb:136:in `sync' --- SNIP --- ``` This commit is inspired by puppetlabs@b61fa20 (puppetlabs#2415)
Without this patch after a gem is uninstalled from puppet's ruby
environment using the
puppet_gem
package
provider other actions inan agent's run fail. For instance, modifying a file fails whilst trying
to back it up.
eg.
This commit is inspired by
b61fa20
(#2415)