Permalink
Browse files

Fix Bug 920059

* 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...
1 parent ba836ba commit 6e1af6b041b8686f77c20e91043b15cd5551d38e @BanzaiMan BanzaiMan committed Mar 26, 2013
Showing with 2 additions and 3 deletions.
  1. +1 −1 lib/rhc/ssh_helpers.rb
  2. +1 −1 lib/rhc/wizard.rb
  3. +0 −1 spec/rhc/helpers_spec.rb
View
2 lib/rhc/ssh_helpers.rb
@@ -122,7 +122,7 @@ def fingerprint_for_local_key(key)
error e.message
nil
rescue => e
- error e.message
+ debug e.message
nil
end
View
2 lib/rhc/wizard.rb
@@ -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
View
1 spec/rhc/helpers_spec.rb
@@ -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

0 comments on commit 6e1af6b

Please sign in to comment.