Bug 658210 - Yum RHN Plugin Exits '0' on Communication Failure
Summary: Yum RHN Plugin Exits '0' on Communication Failure
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: rhnlib
Version: 5.5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Miroslav Suchý
QA Contact: Red Hat Satellite QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-29 17:08 UTC by Marcelo Moreira de Mello
Modified: 2018-11-30 23:10 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-03-14 16:40:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Marcelo Moreira de Mello 2010-11-29 17:08:52 UTC
Description of problem:

The Yum RHN plugin exits '0' when unable to connect to RHN. This leaves us unable to determine an error condition for regular updates if a customer is unable to connect to RHN. 

Version-Release number of selected component (if applicable):
     # rpm -q rhnlib yum
          rhnlib-2.5.22-3.el5_5.1
          yum-3.2.22-26.el5_5.1

     # Red Hat Enterprise Linux 5.5


How reproducible:
100%

Steps to Reproduce:
    # rpm -q yum
        yum-3.2.22-26.el5_5.1
    # rpm -q rhnlib
        rhnlib-2.5.22-3.el5_5.1

    # iptables -A OUTPUT -d xmlrpc.rhn.redhat.com -j REJECT

    # iptables -L -n
        Chain INPUT (policy ACCEPT)
          target     prot opt source               destination
 
        Chain FORWARD (policy ACCEPT)   
          target     prot opt source               destination
 
        Chain OUTPUT (policy ACCEPT) 
          target     prot opt source               destination
    REJECT     all  --  anywhere
xmlvip.rhn.prod.ext.phx2.redhat.com reject-with icmp-port-unreachable


     # yum update
          Loaded plugins: rhnplugin, security
          There was an error communicating with RHN.
          RHN support will be disabled.
          Error communicating with server. The message was:
          Connection refused
          Setting up Update Process
          No Packages marked for Update

      # echo $?
        0 
  
Actual results:
YUM + RHNPLUGIN exits with error code '0'


Expected results:
YUM + RHNPLUGIN exits with error code != '0'

Comment 2 Miroslav Suchý 2011-03-14 16:40:22 UTC
Current design of yum could not allow us to properly set exit code. I filed RFE for yum (bug 684859) and if it will be resolved (and back ported to RHEL5) you can reopen this BZ. But till then, there is nothing I can do.

Comment 3 James Antill 2011-03-14 18:57:47 UTC
 I think for this case you should just either raise PluginYumExit() or even raise Errors.RepoError.

Comment 4 Miroslav Suchý 2011-03-15 09:09:58 UTC
I do not think I want to raise Exit Exception and for sure not in prep phase. This is not fatal event. If you have some local repo, you can proceed without problem and upgrade your system. I just want to give user ability that this plugin had some serious problem. And writing to stdout seems to be out of question.


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