X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fgen_tlsa_entry.rb;fp=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fgen_tlsa_entry.rb;h=5bc39853d397cec3e6147cb84e48c1bac4f9ac37;hb=925ab8ddb02719ba2204a6207c540cc81399f2b0;hp=11ca3e49f3bdeff2ab2fbaf1d0e565e57bb51f11;hpb=aa274d0f5c7a46fef099e461419b7e0b84876524;p=dsa-puppet.git diff --git a/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb b/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb index 11ca3e49..5bc39853 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb @@ -15,7 +15,10 @@ module Puppet::Parser::Functions certfile += ".new" if File.exist?(certfile) cmd = ['swede', 'create', '--usage=3', '--selector=1', '--mtype=1', '--certificate', certfile, '--port', port.to_s, hostname] - IO.popen(cmd, "r") {|i| res << i.read } + IO.popen(cmd, "r") {|i| new_entry = i.read } + if not res.include?(new_entry) + res << new_entry + end end return res.join("\n")