Bug 799561 - rhc-outage sync says it succeeded even when it failed
rhc-outage sync says it succeeded even when it failed
Product: OpenShift Origin
Classification: Red Hat
Component: Website (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fotios Lindiakos
libra bugs
Depends On:
  Show dependency treegraph
Reported: 2012-03-02 20:46 EST by Thomas Wiest
Modified: 2015-05-14 21:05 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-04-13 14:32:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Thomas Wiest 2012-03-02 20:46:06 EST
Description of problem:

rhc-outage prints success during syncing even when a failure occurred. This seems to be because the response object isn't checked in the following code.

      http_req(:get, "#{url}/sync/#{hostname}") do |resp|
        puts "\tSuccess"

The sync here actually failed with "<h1>Internal Server Error</h1>", yet shows success.

[root@ex-srv1 status]# ./rhc-outage sync
Syncing https://ex-srv1.stg.rhcloud.com/app/status
Syncing https://ex-srv2.stg.rhcloud.com/app/status
[root@ex-srv1 status]#

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. Have a failure case
2. Try to sync
3. Notice it failed yet it says success.
Actual results:
says success even when it failed

Expected results:
should tell the failure (as much info as possible)
Comment 1 Fotios Lindiakos 2012-03-05 11:45:51 EST
Fixed in commit: b0260811edc66f3540d38fd0e01281afb9f0bd30
Comment 2 Fotios Lindiakos 2012-03-05 12:48:25 EST
Sorry, wrong commit id. Correct one should be: ec3959a859a6c149215a1abcbb027160f1085013
Comment 3 Xiaoli Tian 2012-03-07 04:38:55 EST
Move it to ON_QA,since the fix is included in the latest build.
Comment 4 Xiaoli Tian 2012-03-07 04:47:17 EST
Verify this bug by setting an invalid host ip in hosts.yml file 

and run ./rhc-outage new issue1 "it's not a good network", it will fail with errors:
	Failed: Server responded with Server not running
	Failed: Server responded with Server not running

BTW,the returned exit code is still "0" even if it failed ,but since it's not an user end command and admin may not care about the exit code,it could be accepted,I'll move it to verified , if any of you think it needs to be fixed, feel free to re-open it.

Note You need to log in before you can comment on or make changes to this bug.