Description of problem: Add an sshkey with non-existing key file path, the command is broken and returns inappropriate messages. Version-Release number of selected component (if applicable): fork_ami_US2600_71 How reproducible: Always Steps to Reproduce: 1. Add an sshkey and specify a non-existing key file rhc sshkey add newkey ~/.ssh/newkey.pub (the ~/.ssh/abc.pub does not exist) Actual results: Command failed [root@ip-10-111-7-229 .ssh]# rhc sshkey add newkey ~/.ssh/newkey.pub /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/commands/sshkey.rb:38:in `initialize': No such file or directory - /root/.ssh/newkey.pub (Errno::ENOENT) from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/commands/sshkey.rb:38:in `open' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/commands/sshkey.rb:38:in `add' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/commands.rb:72:in `send' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/commands.rb:72:in `to_commander' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:180:in `call' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/command.rb:155:in `run' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/runner.rb:385:in `run_active_command' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/command_runner.rb:30:in `run!' from /usr/lib/ruby/gems/1.8/gems/commander-4.0.3/lib/commander/delegates.rb:7:in `run!' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/lib/rhc/cli.rb:36:in `start' from /usr/lib/ruby/gems/1.8/gems/rhc-0.98.7/bin/rhc:65 from /usr/bin/rhc:19:in `load' from /usr/bin/rhc:19 Expected results: Should return messages indicating specified key file does not exist Additional info:
The message indicates this, though. No such file or directory - /root/.ssh/newkey.pub (Errno::ENOENT) Are you saying that the command should hide the backtrace?
The fix is quite easy, of course, but I will consult others before committing to a fix for this.
This bug is verified on fork_ami_US2600_76. Steps to verify: 1.Add an non-existing pub key: $ rhc sshkey add newkey ~/.ssh/newkey.pub Results: 1. File '/root/.ssh/newkey.pub' does not exist.