Skip to content

(Modules 4377) Causes ensure_packages to accept concurrent declarations with ensure => 'present' and 'installed' #716

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

Merged
merged 2 commits into from
Jul 7, 2017

Conversation

EmersonPrado
Copy link

If user declares ensure_packages(, { ensure => 'present' }) and ensure_packages(, { ensure => 'installed' }) concurrently, funcion fails at different 'ensure' values. This change causes function to change 'installed' to 'present', avoiding this error.
Maybe similar treatment is needed when arguments[0] is a hash, but I'm an absolute beginner in Ruby.

Emerson Prado added 2 commits February 3, 2017 17:00
If user declares ensure_package concurrently with ensure values
'present' and 'installed', function fails as if values were different

Change causes function to interpret ensure => 'installed' as 'present',
effectively elliminating the error

Also works if user doesn't specify ensure value, since 'present'
is the default
@EmersonPrado
Copy link
Author

I would appreciate some help regarding the failed checks. They don't seem to be related to my commits, but I'm not sure.
Both point to line 3 of spec/acceptance/zip_spec.rb, which is require 'puppet', and complain that 'Hiera is not a class (TypeError)'.

I also found 2 excerpts that called my attention regarding the errors:

Gemfile

# Only explicitly specify Facter/Hiera if a version has been specified.
# Otherwise it can lead to strange bundler behavior...
gem 'hiera', *location_for(ENV['HIERA_GEM_VERSION']) if ENV['HIERA_GEM_VERSION']

lib/puppet/parser/functions/ensure_resources.rb

From Hiera Backend:
...
Call:
ensure_resources('user', hiera_hash('userlist'), {'ensure' => 'present'})

Does this tell anything?

Thanks a lot.

@EmersonPrado
Copy link
Author

Still regarding the test error, there is a question in Ask Puppet reporting the exact same error, and also related to the exact same test:
https://ask.puppet.com/question/28542/hiera-is-not-a-class-typeerror/
The only answer so far mentions auto-generated Rake tests as a possible cause for the error. Maybe this should go for a new ticket.

@EmersonPrado
Copy link
Author

Seems like a bug in Beaker:
https://tickets.puppetlabs.com/browse/BKR-969

@esalberg
Copy link

+1 - We have run into this too.

@EmersonPrado
Copy link
Author

Seems like commit 2c6c2ff fixed the errors.

@tphoney
Copy link
Contributor

tphoney commented Jul 7, 2017

Thanks for the PR @EmersonPrado good work !!!

@tphoney tphoney merged commit 5a17bf1 into puppetlabs:master Jul 7, 2017
ekohl pushed a commit to theforeman/puppet-foreman_proxy that referenced this pull request Jul 10, 2017
juliantodt pushed a commit to juliantodt/puppet-foreman_proxy that referenced this pull request Jun 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants