Bug 799561 - rhc-outage sync says it succeeded even when it failed
Summary: rhc-outage sync says it succeeded even when it failed
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Website
Version: 2.x
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Fotios Lindiakos
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-03-03 01:46 UTC by Thomas Wiest
Modified: 2015-05-15 01:05 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-04-13 18:32:13 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Thomas Wiest 2012-03-03 01:46:06 UTC
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"
      end

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
	Success
	Success
Syncing https://ex-srv2.stg.rhcloud.com/app/status
	Success
	Success
[root@ex-srv1 status]#



Version-Release number of selected component (if applicable):
rhc-site-0.87.16-1.el6_2.noarch


How reproducible:
100%

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 16:45:51 UTC
Fixed in commit: b0260811edc66f3540d38fd0e01281afb9f0bd30

Comment 2 Fotios Lindiakos 2012-03-05 17:48:25 UTC
Sorry, wrong commit id. Correct one should be: ec3959a859a6c149215a1abcbb027160f1085013

Comment 3 Xiaoli Tian 2012-03-07 09:38:55 UTC
Move it to ON_QA,since the fix is included in the latest build.

Comment 4 Xiaoli Tian 2012-03-07 09:47:17 UTC
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:
Syncing https://10.1.2.3/app/status
	Failed: Server responded with Server not running
Syncing https://10.2.3.4/app/status
	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.