From 9b9856b60e823a431e9ea06b42da64c231eeef36 Mon Sep 17 00:00:00 2001 From: david Date: Tue, 7 Aug 2007 11:42:33 +0000 Subject: fix "fail on no ntp_ plugins" bug git-svn-id: http://club.black.co.at:82/svn/manifests/trunk@176 f03ff2f1-f02d-0410-970d-b9634babeaa1 --- files/functions/gsub.rb | 8 +++++++- files/functions/split.rb | 7 +++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 files/functions/split.rb (limited to 'files') diff --git a/files/functions/gsub.rb b/files/functions/gsub.rb index 743a700..371820f 100644 --- a/files/functions/gsub.rb +++ b/files/functions/gsub.rb @@ -1,7 +1,13 @@ # generic gsub call module Puppet::Parser::Functions newfunction(:gsub, :type => :rvalue) do |args| - args[0].gsub(/#{args[1]}/, args[2]) + if args[0].is_a?(Array) + args[0].collect do |val| + val.gsub(/#{args[1]}/, args[2]) + end + else + args[0].gsub(/#{args[1]}/, args[2]) + end end end diff --git a/files/functions/split.rb b/files/functions/split.rb new file mode 100755 index 0000000..d08a40b --- /dev/null +++ b/files/functions/split.rb @@ -0,0 +1,7 @@ +# generic split call +module Puppet::Parser::Functions + newfunction(:split, :type => :rvalue) do |args| + args[0].split(/#{args[1]}/) + end +end + -- cgit v1.2.3