stdlib::ensure: update function to support the generic case#1286
Merged
LukasAud merged 1 commit intopuppetlabs:mainfrom Dec 19, 2022
Merged
stdlib::ensure: update function to support the generic case#1286LukasAud merged 1 commit intopuppetlabs:mainfrom
LukasAud merged 1 commit intopuppetlabs:mainfrom
Conversation
ekohl
requested changes
Dec 9, 2022
c1af0af to
af234cc
Compare
ekohl
previously approved these changes
Dec 14, 2022
Collaborator
ekohl
left a comment
There was a problem hiding this comment.
Would you mind squashing the commits?
I'd also appreciate if someone else took a look since I suggested the implementation.
d7bf698 to
1511f09
Compare
Collaborator
Author
done
sure no rush my end |
kenyon
suggested changes
Dec 14, 2022
Often custom resources only support present/absent for the ensure
parameter and often the inclusion of theses resources are enabled via
some boolean value as such i often find my self using the following
pattern
$ensure_feature = $enable_feature.bool2str('ensure', 'present')
This patch updates the stdlib::ensure function so we can simplify this to
$ensure_feature = $enable_feature.stdlib::ensure # or ...
$ensure_feature = stdlib::ensure($enable_feature)
Update spec/functions/stdlib_ensure_spec.rb
Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
Update spec/functions/stdlib_ensure_spec.rb
Co-authored-by: Ewoud Kohl van Wijngaarden <ewoud@kohlvanwijngaarden.nl>
1511f09 to
fb3a5a6
Compare
Collaborator
Author
done |
kenyon
approved these changes
Dec 16, 2022
ekohl
approved these changes
Dec 16, 2022
Collaborator
ekohl
left a comment
There was a problem hiding this comment.
In this repository Puppet's module team needs to approve before it can be merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Often custom resources only support present/absent for the ensure parameter and often the inclusion of theses resources are enabled via some boolean value as such i often find my self using the following pattern
This patch updates the stdlib::ensure function so we can simplify this to