-
Notifications
You must be signed in to change notification settings - Fork 580
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
Flip installed and present in Function ensure_packages #1196
Conversation
Flip "installed" and "present" in Function "ensure_packages". Puppet-Type "package" defaults to "installed" and not to "present" (compare https://github.com/puppetlabs/puppet/blob/main/lib/puppet/type/package.rb#L148). This Misconception lies in the Code since the most early Days. With flipping these two Values, Rspec-Tests do not have to be adapted, when migrating from "package {}" to "ensure_packages()".
LGTM |
Hi Puppet, |
This may be true, but as Exactly this is my Point: When I have |
I don't mind having this merged, I just think it's backwards incompatible and the next stdlib release should be 8.0.0 and not 7.x. |
I'm not entirely sure whether I agree. While functionally it's a change, I think it doesn't really warrant a major version bump because for end users it doesn't change anything. You can argue that the testing method that was linked was checking internal behavior of Another thing that we should consider is that many (most?) Puppet modules use git checkouts so the version number is really irrelevant. Weighing this against the very painful costs for stdlib (so many modules need updating), I don't think we should. That said, I have changed the PR title because it was really not covering the intent of this PR. That makes for an unusable changelog entry. |
$package_ensure default needs to be changed due to puppetlabs/puppetlabs-stdlib#1196
$package_ensure default needs to be changed due to puppetlabs/puppetlabs-stdlib#1196 Also convert docs to Puppet Strings format.
As of version 8.0.0 the 'puppetlabs-stdlib' module updated the `ensure_packages` function from 'present' to 'installed': puppetlabs/puppetlabs-stdlib#1196 This commit addresses the single usage of `ensure_packages` function in a dependent component module 'theforeman-dns'. Verification (complete suite): * `pdk test unit` Result: * Finished in 1 minute 3.18 seconds (files took 1.09 seconds to load) 685 examples, 0 failures
This allows for better compatibility with puppetlabs-stdlib version 8 and use of ensure_packages('ca-certificates') (such as the puppet-openssl does) due to puppetlabs/puppetlabs-stdlib#1196. Otherwise you can get a duplicate resource declaration error due to the mismatch in the ensure value.
This allows for better compatibility with puppetlabs-stdlib version 8 and use of ensure_packages('ca-certificates') (such as the puppet-openssl does) due to puppetlabs/puppetlabs-stdlib#1196. Otherwise you can get a duplicate resource declaration error due to the mismatch in the ensure value.
This allows for better compatibility with puppetlabs-stdlib version 8 and use of ensure_packages('ca-certificates') (such as the puppet-openssl does) due to puppetlabs/puppetlabs-stdlib#1196. Otherwise you can get a duplicate resource declaration error due to the mismatch in the ensure value.
This allows for compatibility with stdlib v8 due to puppetlabs/puppetlabs-stdlib#1196.
@ekohl It looks like it breaks all of my actual catalogs. I've just run a catalog-diff against a branch with stdlib 8.2.0 vs 5.2.0 and I've got ~1600 compilation failures. Duplicate declaration of package resources. :( |
The following compiled before, and now it doesn't. package { 'tzdata':
ensure => present,
}
ensure_packages(['tzdata'])
|
…abs/puppetlabs-stdlib#1196) - Removed test coverage for Ubuntu 14.04.
…abs/puppetlabs-stdlib#1196) - Updated `pdk` template version. - Added unit test coverage for Debian 11. - Removed test coverage for Ubuntu 14.04.
For compatibility with puppetlabs/puppetlabs-stdlib#1196. Fixes voxpupuli#1522.
For compatibility with puppetlabs/puppetlabs-stdlib#1196. Fixes voxpupuli#1522.
For compatibility with puppetlabs/puppetlabs-stdlib#1196. Fixes voxpupuli#1522.
This unbreaks the breaking change made in puppetlabs#1196 Also refactored to create a separate dispatch method for the case when `packages` is a `Hash`, and having that call the main `ensure_packages` method. This simplifies the code by only ever calling `ensure_resource` instead of calling `ensure_resources` for hashes. Defaulting `default_attributes` to an empty hash instead of `nil` in the method signatures further simplifies the code. Fixes puppetlabs#1252
This unbreaks the breaking change made in puppetlabs#1196 Also refactored to create a separate dispatch method for the case when `packages` is a `Hash`, and having that call the main `ensure_packages` method. This simplifies the code by only ever calling `ensure_resource` instead of calling `ensure_resources` for hashes. Defaulting `default_attributes` to an empty hash instead of `nil` in the method signatures further simplifies the code. Fixes puppetlabs#1252
This unbreaks the breaking change made in puppetlabs#1196 Also refactored to create a separate dispatch method for the case when `packages` is a `Hash`, and having that call the main `ensure_packages` method. This simplifies the code by only ever calling `ensure_resource` instead of calling `ensure_resources` for hashes. Defaulting `default_attributes` to an empty hash instead of `nil` in the method signatures further simplifies the code. Fixes puppetlabs#1252
This unbreaks the breaking change made in puppetlabs#1196 Also refactored to create a separate dispatch method for the case when `packages` is a `Hash`, and having that call the main `ensure_packages` method. This simplifies the code by only ever calling `ensure_resource` instead of calling `ensure_resources` for hashes. Defaulting `default_attributes` to an empty hash instead of `nil` in the method signatures further simplifies the code. Fixes puppetlabs#1252
This unbreaks the breaking change made in puppetlabs#1196 Also refactored to create a separate dispatch method for the case when `packages` is a `Hash`, and having that call the main `ensure_packages` method. This simplifies the code by only ever calling `ensure_resource` instead of calling `ensure_resources` for hashes. Defaulting `default_attributes` to an empty hash instead of `nil` in the method signatures further simplifies the code. Fixes puppetlabs#1252
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
Flip present to installed in cifs_mount_spec due to puppetlabs/puppetlabs-stdlib#1196
Flip present to installed in cifs_mount_spec due to puppetlabs/puppetlabs-stdlib#1196
Flip present to installed in cifs_mount_spec due to puppetlabs/puppetlabs-stdlib#1196
Flip present to installed in cifs_mount_spec due to: puppetlabs/puppetlabs-stdlib#1196
Flip present to installed in cifs_mount_spec due to: puppetlabs/puppetlabs-stdlib#1196
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
Flip present to installed in cifs_mount_spec due to: puppetlabs/puppetlabs-stdlib#1196
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
For compatibility with puppetlabs/puppetlabs-stdlib#1196.
Flip
installed
andpresent
in Functionensure_packages
.Puppet-Type
package
defaults toinstalled
and not topresent
(compare here ).This Misconception lies in the Code since the most early Days.
With flipping these two Values, Rspec-Tests do not have to be adapted, when migrating from
package {}
toensure_packages()
.