Bug 863997 - yum check-update with rhnplugin doesn't set correct exit code on error
yum check-update with rhnplugin doesn't set correct exit code on error
Product: Spacewalk
Classification: Community
Component: Clients (Show other bugs)
Unspecified Unspecified
medium Severity high
: ---
: ---
Assigned To: Milan Zázrivec
Red Hat Satellite QA List
: Patch
Depends On:
Blocks: space18
  Show dependency treegraph
Reported: 2012-10-08 05:47 EDT by Milan Zázrivec
Modified: 2012-11-01 12:17 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 802636
Last Closed: 2012-11-01 12:17:36 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 Milan Zázrivec 2012-10-08 05:47:29 EDT
+++ This bug was initially created as a clone of Bug #802636 +++

Description of problem:

The yum man page says the following:
"   check-update
Implemented  so  you  could know if your machine had any updates that needed to be applied without running it interactively. Returns exit value of 100 if there are packages available for an update. Also returns a list of the packages to  be  updated in  list format. Returns 0 if no packages are available for update. Returns 1 if an error occurred.  Running in verbose mode
also shows obsoletes."

However when system is not able to reach rhn/satellite it returns 0 instead of 1 :

# yum check-update
Loaded plugins: product-id, rhnplugin, subscription-manager
Updating certificate-based repositories.
There was an error communicating with RHN.
RHN Satellite or RHN Classic support will be disabled.
Error communicating with server. The message was:
Connection refused

# echo $?

It should have returned 1 instead of 0

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

How reproducible:

Steps to Reproduce:
1.Edit /etc/sysconfig/rhn/update file and alter the rhn/satellite FQDN under  serverURL in such a way that system is unable to reach it or unable to resolve the FQDN
2.Execute :
yum check-update
3. Once it fails then execute :
echo $?
Actual results:

Expected results:

Additional info:
Comment 1 Milan Zázrivec 2012-10-08 05:50:08 EDT
spacewalk.git master: bc6db8afd41432b63ecf55835d1e1c0a99591c01
Comment 2 Jan Pazdziora 2012-10-30 15:22:37 EDT
Moving ON_QA. Packages that address this bugzilla should now be available in yum repos at http://yum.spacewalkproject.org/nightly/
Comment 3 Jan Pazdziora 2012-11-01 12:17:36 EDT
Spacewalk 1.8 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes18

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