-
Notifications
You must be signed in to change notification settings - Fork 89
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
Legacy 3.x function #121
Comments
Partial fix: -module Puppet::Parser::Functions
- newfunction(:consul_template_sorted_json, type: :rvalue, doc: <<-EOS
-This function takes unsorted hash and outputs JSON object making sure the keys are sorted.
-Optionally you can pass 2 additional parameters, pretty generate and indent length.
-
-*Examples:*
- [..snap..]
+Puppet::Functions.create_function(:consul_template_sorted_json) do
+ def consul_template_sorted_json(*args)
unsorted_hash = args[0] || {}
pretty = args[1] || false
indent_len = args[2].to_i || 4
-
return JSON.sorted_pretty_generate(unsorted_hash, indent_len) << "\n" if pretty
JSON.sorted_generate(unsorted_hash)
end I have still this error:
|
Were you able to solve this? |
For anyone else running into this, someone else has already solved it in their fork (no PR from them yet): https://github.com/l-lotz/puppet-consul_template |
+1 for the PR |
Hello guys, do you plan to fix/merge this in the near future ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Affected Puppet, Ruby, OS and module versions/distributions
6.2.0
2.2.1
Output log
The text was updated successfully, but these errors were encountered: