Skip to content

Commit d2b22b9

Browse files
author
Michael Power
committed
add storetype parameter comparison to 'destroy' method
Without this comparison, attempting to destroy a jceks keystore will fail.
1 parent ba5325c commit d2b22b9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/puppet/provider/java_ks/keytool.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@ def destroy
261261
'-alias', @resource[:name],
262262
'-keystore', @resource[:target]
263263
]
264+
cmd += ['-storetype', storetype] if storetype == :jceks
264265
tmpfile = password_file
265266
run_command(cmd, false, tmpfile)
266267
tmpfile.close!

spec/unit/puppet/provider/java_ks/keytool_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211

212212
describe 'when removing entries from keytool' do
213213
it 'executes keytool with a specific set of options' do
214-
expect(provider).to receive(:run_command).with(['mykeytool', '-delete', '-alias', resource[:name], '-keystore', resource[:target]], any_args)
214+
expect(provider).to receive(:run_command).with(['mykeytool', '-delete', '-alias', resource[:name], '-keystore', resource[:target], '-storetype', resource[:storetype]], any_args)
215215
provider.destroy
216216
end
217217
end

0 commit comments

Comments
 (0)