Description of problem:
When I'm running through proxy which is stopped, yum fails (which is OK), but it fails with different exception than expected.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Register yourself to RHN (RHN Satellite in my case)
2. Configure yum-rhn-plugin to run through proxy
# grep -i proxy /etc/sysconfig/rhn/up2date | grep -v comment
3. Stop the proxy
# service squid stop
4. Try to install some package from RHN channel
# yum install -y test-package
# yum install -y test-regular-mon07nov2011_12_56_42_27745-0.1-1
Loaded plugins: rhnplugin
Traceback (most recent call last):
File "/usr/bin/yum", line 29, in ?
File "/usr/share/yum-cli/yummain.py", line 309, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 157, in main
File "/usr/share/yum-cli/cli.py", line 187, in getOptionsConfig
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 665, in <lambda>
conf = property(fget=lambda self: self._getConfig(),
File "/usr/lib/python2.4/site-packages/yum/__init__.py", line 254, in _getConfig
File "/usr/lib/python2.4/site-packages/yum/plugins.py", line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/rhnplugin.py", line 148, in init_hook
conduit.error(0, COMMUNICATION_ERROR + "\n" + CHANNELS_DISABLED +
File "/usr/lib/python2.4/site-packages/yum/Errors.py", line 32, in __str__
return "%s" %(self.value,)
AttributeError: CommunicationError instance has no attribute 'value'
Error message should state there is a problem with connection.
From code inspection this seems to be caused by a mishmash of which variable yum and yum-rhn-plugin are using to store exception string:
=== yum uses self.value in its exceptions ===
# vim /usr/lib/python2.4/site-packages/yum/Errors.py
Base Yum Error. All other Errors thrown by yum should inherit from
def __init__(self, value=None):
self.value = value
return "%s" %(self.value,)
=== yum-rhn-plugin uses self.errmsg ===
# vim /usr/share/rhn/up2date_client/up2dateErrors.py
"""base class for errors"""
def __init__(self, errmsg):
self.errmsg = errmsg
self.log = up2dateLog.initLog()
This is just special case (or better: consequence) of bug 595837.
Fixed in spacewalk.git as commit 1bdc55b83a00d48bb263ba7d4f9c13d3b0ddbb1e
I forgot that backend still use errmsg, so I created setter and getter for errmsg as alias to value.
commited as 61d62a5a31cdfb5094987c2575a5b0a56e9c194d and 369c6fb728bf69c742d1f526244c753b401e0c7a
both commits cherrypicked to svn as rev. 208312.
Fixed in rev. 208328.
*** Bug 756324 has been marked as a duplicate of this bug. ***
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.