Red Hat Bugzilla – Bug 1020473
SSH commands issued from rhc which exit with non-zero status result in "Success" and zero exit code from rhc itself
Last modified: 2015-05-14 22:25:48 EDT
Description of problem:
When executing an rhc command which internally uses `ssh_ruby` to issue an SSH command which returns a nonzero exit code, rhc will still report "Success" to the client and return a zero exit code. When issuing the same command via ssh directly, the correct error code is returned to the client.
Version-Release number of selected component (if applicable):
Try the `rhc deploy ...` command with an invalid git ref which will produce an error that is still reported as zero/success by rhc.
Steps to Reproduce:
1. Create an unscaled nodejs-0.6 application
2. Run `rhc deploy bogusref -a nodeapp`
3. Compare the results to `ssh user@host "gear deploy bogusref"`
rhc reports success and a zero exit code. ssh reports failure and a non-zero exit code.
rhc to report failure and a nonzero exit code.
Fixed in pull request https://github.com/openshift/rhc/pull/487
Verified on devenv_3921,rhc build from devenv_3921
openshift@openshift-ubuntu:~/test$ rhc deploy bogusref -a nd
Deployment of git ref 'bogusref' in progress for application nd ...
Git ref bogusref is invalid
Error trying to deploy git ref. You can ssh to your application and try to deploy manually with:
gear deploy bogusref
SSH command finished with exit status = 255
openshift@openshift-ubuntu:~/test$ echo $?