puppet-neutron/lib/puppet/functions/convert_cert_to_string.rb
Tim Rozet 65107cb5a8 Adds TLS support to configuring OVS with OpenDaylight
Enables configuring OVS with SSL configuration, as well as setting
OVS managers and ODL check url to use SSL/TLS.  Each OVS will also
register their certificate with OpenDaylight's truststore.

Partially-Implements: blueprint opendaylight-ssl-support

Depends-On: Ic026ee0bc4f385e0f8cd7076b3044feeb935ae45

Change-Id: I719e8dddbd00d19fd8e1bd2a20dabd600b7b9d1c
Signed-off-by: Tim Rozet <trozet@redhat.com>
2018-01-16 15:03:55 -05:00

20 lines
494 B
Ruby

Puppet::Functions.create_function(:convert_cert_to_string) do
dispatch :convert_cert_to_string do
param 'String', :cert_file
end
def convert_cert_to_string(cert_file)
unless File.file?(cert_file)
raise puppet::ParseError, "Certificate file not found: #{cert_file}"
end
text=File.readlines(cert_file)
cert_string = ''
text.each do |line|
unless line.include? '-----'
cert_string += line.strip
end
end
return cert_string
end
end