Skip to content

Commit 63e69b2

Browse files
committed
Correctly pass the path to the tempfile when adding keystore certificates
This was previously pass the name of the File object in Ruby to keytool creating a temporary file at the location that the module is executed at to serve as the temporary file. This means that the result continues to work -- a keystore certificates is imported into the final destination but it was leaving behind residual files.
1 parent 16478ba commit 63e69b2

File tree

1 file changed

+2
-2
lines changed
  • lib/puppet/provider/keystore_certificate

1 file changed

+2
-2
lines changed

lib/puppet/provider/keystore_certificate/openssl.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def add_certificate
3838
'-export',
3939
'-in', resource[:certificate],
4040
'-inkey', resource[:private_key],
41-
'-out', temp_store,
41+
'-out', temp_store.path,
4242
'-name', resource[:alias],
4343
'-CAfile', resource[:ca],
4444
'-password', "file:#{resource[:password_file]}"
@@ -47,7 +47,7 @@ def add_certificate
4747
keytool(
4848
'-importkeystore',
4949
'-noprompt',
50-
'-srckeystore', temp_store,
50+
'-srckeystore', temp_store.path,
5151
'-srcstorepass:file', resource[:password_file],
5252
'-destkeystore', resource[:keystore],
5353
'-deststorepass:file', resource[:password_file],

0 commit comments

Comments
 (0)