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'
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.
I think for this case you should just either raise PluginYumExit() or even raise Errors.RepoError.
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.