My new/current gainful employment entails looking after a fleet of ageing CentOS machines, which I’m slowly getting into a manageable state using ansible (except for those running CentOS 4(!) ).
One of them gave me a weird error after installing the zabbix-agent package via ansible, which may or may not have been a pre-existing condition or actually caused by what I was doing.

$ sudo yum makecache

Traceback (most recent call last):
File "/usr/bin/yum", line 29, in 
yummain.user_main(sys.argv[1:], exit_code=True)
File "/usr/share/yum-cli/yummain.py", line 298, in user_main
errcode = main(args)
File "/usr/share/yum-cli/yummain.py", line 110, in main
base = cli.YumBaseCli()
File "/usr/share/yum-cli/cli.py", line 72, in __init__
output.YumOutput.__init__(self)
File "/usr/share/yum-cli/output.py", line 307, in __init__
self.reported_error_msgs = dict((k, False) for (k, v) in ERRORS_TO_KBASE_ARTICLES.iteritems())
NameError: global name 'ERRORS_TO_KBASE_ARTICLES' is not defined

After a period of investigation, I managed to track this down from following what was recently updated in /usr/share/doc and then a ‘rpm -qa | grep yum’ on an equivalent machine to find out what versions it should have.

For some reason, the yum-3.2.29-81.el6.centos.noarch.rpm package was updated to yum-3.2.29-81.el6.centos.0.1.noarch and it wasn’t happy – my guess is the libraries used by the python yum-cli functions.

So I found the previous version on a mirror site, removed the broken one and installed the previous:

wget http://mirror.centos.org/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
sudo rpm -e --nodeps yum-3.2.29-81.el6.centos.0.1.noarch # to remove the broken package without breaking everything else
sudo rpm -iv --replacepkgs yum-3.2.29-81.el6.centos.noarch.rpm