Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

Commit

Permalink
Fix Bug 920059
Browse files Browse the repository at this point in the history
* When the public key does not exist, put the error message for debugging, not to STDERR.
* Instead, warn the user when the public key does not exist--only once.
* Includes a corresponding change to the spec, since there is no output to STDERR.
  • Loading branch information
BanzaiMan committed Mar 26, 2013
1 parent ba836ba commit 6e1af6b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/rhc/ssh_helpers.rb
Expand Up @@ -122,7 +122,7 @@ def fingerprint_for_local_key(key)
error e.message
nil
rescue => e
error e.message
debug e.message
nil
end

Expand Down
2 changes: 1 addition & 1 deletion lib/rhc/wizard.rb
Expand Up @@ -245,7 +245,7 @@ def get_preferred_key_name
key_fingerprint = fingerprint_for_default_key
unless key_fingerprint
paragraph do
say "Your ssh public key at #{system_path(RHC::Config.ssh_pub_key_file_path)} is invalid or unreadable. "\
warn "Your ssh public key at #{system_path(RHC::Config.ssh_pub_key_file_path)} is invalid or unreadable. "\
"Setup can not continue until you manually remove or fix your "\
"public and private keys id_rsa keys."
end
Expand Down
1 change: 0 additions & 1 deletion spec/rhc/helpers_spec.rb
Expand Up @@ -369,7 +369,6 @@ def options

it "should catch exceptions from fingerprint failures" do
Net::SSH::KeyFactory.should_receive(:load_public_key).with('1').and_raise(StandardError.new("An error"))
subject.should_receive(:error).with('An error')
subject.fingerprint_for_local_key('1').should be_nil
end
end
Expand Down

0 comments on commit 6e1af6b

Please sign in to comment.