summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2015-11-05 21:53:09 +0100
committervarac <varacanero@zeromail.org>2015-11-17 19:51:11 +0100
commitdfe3a3415bffa554e47243322bba3e27ee45795d (patch)
treef45f7ecccf5daf97c4419c6c665281342079b031
parent20dd8f27004a5dac0ad68113f4b8038cb34bc791 (diff)
[bug] [jessie] Fix webapp config yaml on jessie
- Resolves: #7578
-rw-r--r--puppet/lib/puppet/parser/functions/sorted_yaml.rb16
1 files changed, 14 insertions, 2 deletions
diff --git a/puppet/lib/puppet/parser/functions/sorted_yaml.rb b/puppet/lib/puppet/parser/functions/sorted_yaml.rb
index fa0db4d2..46cd46ce 100644
--- a/puppet/lib/puppet/parser/functions/sorted_yaml.rb
+++ b/puppet/lib/puppet/parser/functions/sorted_yaml.rb
@@ -382,7 +382,19 @@ class Ya2YAML
end
module Puppet::Parser::Functions
- newfunction(:sorted_yaml, :type => :rvalue, :doc => "This function outputs yaml, but ensures the keys are sorted.") do |argument|
- return Ya2YAML.new()._ya2yaml(argument)
+ newfunction(:sorted_yaml,
+ :type => :rvalue,
+ :doc => "This function outputs yaml, but ensures the keys are sorted."
+ ) do |arguments|
+
+ if arguments.is_a?(Array)
+ if arguments.size != 1
+ raise(Puppet::ParseError, "sorted_yaml(): Wrong number of arguments given (#{arguments.size} for 1)")
+ end
+ yaml = arguments.first
+ else
+ yaml = arguments
+ end
+ return Ya2YAML.new()._ya2yaml(yaml)
end
end