X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=modules%2Fpuppetmaster%2Flib%2Fpuppet%2Fparser%2Ffunctions%2Fgen_tlsa_entry.rb;h=7b846b90c327ba98c59ae792b3c26ec17438b27e;hb=a97bb246b7122f4bb7686b9b48ee379e00bf4914;hp=5bc39853d397cec3e6147cb84e48c1bac4f9ac37;hpb=925ab8ddb02719ba2204a6207c540cc81399f2b0;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 5bc39853..7b846b90 100644 --- a/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb +++ b/modules/puppetmaster/lib/puppet/parser/functions/gen_tlsa_entry.rb @@ -12,9 +12,9 @@ module Puppet::Parser::Functions res << "; certfile #{certfile} did not exist to create TLSA record for #{hostname}:#{port}." end - certfile += ".new" - if File.exist?(certfile) + if certfile.gsub!(/\.crt$/, '-new.crt') and File.exist?(certfile) cmd = ['swede', 'create', '--usage=3', '--selector=1', '--mtype=1', '--certificate', certfile, '--port', port.to_s, hostname] + new_entry = '' IO.popen(cmd, "r") {|i| new_entry = i.read } if not res.include?(new_entry) res << new_entry