-
Notifications
You must be signed in to change notification settings - Fork 581
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
stdlib::ensure: update function to support the generic case #1286
Conversation
c1af0af
to
af234cc
Compare
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.
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
done
sure no rush my end |
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.
Would be good to fix the typo in the PR title and commit message, spport :)
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
done |
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.
In this repository Puppet's module team needs to approve before it can be merged.
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.
LGTM
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