From: Peter Palfrader Date: Mon, 1 Jul 2013 12:03:20 +0000 (+0200) Subject: Only include new entry if it has a different key X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=925ab8ddb02719ba2204a6207c540cc81399f2b0;p=mirror%2Fdsa-puppet.git Only include new entry if it has a different key --- 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 11ca3e49f..5bc39853d 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")