Reinstall requests on Fedora builds

The fedora-minimal builds do not include the package python-requests,
but some of the later puppet (via zuul) will end up pip-installing it.

This leaves the system in a very precarious state -- if the
python-requests package ever gets installed over the pip-installed
package everything is broken because of the vendoring/symlinking
issues mentioned in the comment.

This is the most logical place to fix this up so we're in a consistent
state with a pip-managed requests package.  Devstack can clean this up
(I6b06dcd897999e0642b387e8d13a473934ed0956) but better to have the
base system in a consistent state.

Change-Id: If3f244ed4f62da25dc42813b4bda2f374f002517
This commit is contained in:
Ian Wienand 2016-02-29 14:29:07 +11:00
parent 7344c9a1c9
commit b625131727

View File

@ -102,6 +102,21 @@ function setup_puppet_fedora {
# https://bugzilla.redhat.com/show_bug.cgi?id=1254616
sudo sed -i.bak '/^[^#].*/ s|\(^.*confine :exists => \"/run/systemd/system\".*$\)|#\ \1|' \
/usr/share/ruby/vendor_ruby/puppet/provider/service/systemd.rb
# upstream "requests" pip package vendors urllib3 and chardet
# packages. The fedora packages un-vendor this, and symlink those
# sub-packages back to packaged versions. We get into a real mess
# of if some of the puppet ends up pulling in "requests" from pip,
# and then something like devstack does a "yum install
# python-requests" which does a very bad job at overwriting the
# pip-installed version (symlinks and existing directories don't
# mix). The solution is to pre-install the python-requests
# package; clear it out and re-install from pip. This way, the
# package is installed for dependencies, and we have a pip-managed
# requests with correctly vendored sub-packages.
sudo ${YUM} install -y python-requests
sudo rm -rf /usr/lib/python2.7/site-packages/requests/*
sudo pip install requests
}
function setup_puppet_rhel7 {