username=usernameBut, at least on the older versions of Centos, this does not work. Problem is that yum relies on python library called "urlgrabber" for connection. The version of this library that is available on repositories doesn't seem to working. You can see the packages in the repository with "yum info", "yum search" but you cannot install them.
I resolved this problem by installing urlgrabber from sources:
git clone git://yum.baseurl.org/urlgrabber.git/That got it working.
python setup.py install