1 Puppet::Functions.create_function(:convert_cert_to_string) do
2 dispatch :convert_cert_to_string do
3 param 'String', :cert_file
6 def convert_cert_to_string(cert_file)
7 unless File.file?(cert_file)
8 raise puppet::ParseError, "Certificate file not found: #{cert_file}"
10 text=File.readlines(cert_file)
13 unless line.include? '-----'
14 cert_string += line.strip