1 Puppet::Parser::Functions::newfunction(:bool2httpd, :type => :rvalue, :doc => <<-EOS
2 Transform a supposed boolean to On or Off. Pass all other values through.
3 Given a nil value (undef), bool2httpd will return 'Off'
8 $server_signature = 'mail'
10 bool2httpd($trace_enable)
12 bool2httpd($server_signature)
19 raise(Puppet::ParseError, "bool2httpd() wrong number of arguments. Given: #{args.size} for 1)") if args.size != 1
23 if arg.nil? or arg == false or arg =~ /false/i or arg == :undef
25 elsif arg == true or arg =~ /true/i