Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding puppet noop support #112

Merged
merged 3 commits into from
Mar 2, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Revert "Adding puppet noop support"
This reverts commit 95fb083.
  • Loading branch information
jitran committed Feb 26, 2015
commit 01e8f6eb505cb978617a9ab5b5415d3dca0a6a01
8 changes: 5 additions & 3 deletions lib/puppet/provider/java_ks/keytool.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ def latest
'-v', '-printcert', '-file', certificate
]
output = run_command(cmd)
return Puppet[:noop] ? output : output.scan(/MD5:\s+(.*)/)[0][0]
latest = output.scan(/MD5:\s+(.*)/)[0][0]
return latest
end

# Reading the fingerprint of the certificate currently in the keystore.
Expand All @@ -104,7 +105,8 @@ def current
tmpfile = password_file
output = run_command(cmd, false, tmpfile)
tmpfile.close!
return Puppet[:noop] ? output : output.scan(/Certificate fingerprints:\n\s+MD5: (.*)/)[0][0]
current = output.scan(/Certificate fingerprints:\n\s+MD5: (.*)/)[0][0]
return current
end

# Determine if we need to do an import of a private_key and certificate pair
Expand Down Expand Up @@ -201,7 +203,7 @@ def run_command(cmd, target=false, stdinfile=false, env={})
end

# Now run the command
options = {:failonfail => Puppet[:noop] ? false : true, :combine => true}
options = {:failonfail => true, :combine => true}
output = if stdinfile
withenv.call(env) do
exec_method.call(cmd, options.merge(:stdinfile => stdinfile.path))
Expand Down