Skip to content

Commit bdc90c5

Browse files
committed
Work around pip installed pkgs on Rackspace image
The upstream rackspace image has a bunch of pip installed packages as cloud-init was installed via pip due to a lack of available system packages. This can break further system package installs, such as markdown, which fails with --- Error unpacking rpm package python-markdown-2.4.1-1.el7.noarch error: unpacking of archive failed on file /usr/lib/python2.7/site-packages/Markdown-2.4.1-py2.7.egg-info: cpio: rename --- Because that is a directory for the pip-installed package, and a file in the RPM Remove all pip installed packages on rackspace images before we start to work around this. I have filed an upstream issue with Rackspace (ticket-id 140804-ord-0000134) and the issue is being worked on. Change-Id: Id12d175143ed3b8e024d057d65fa67505c08042a
1 parent a36167e commit bdc90c5

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

functions-common

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,13 @@ function is_arch {
466466
[[ "$(uname -m)" == "$1" ]]
467467
}
468468

469+
# Quick check for a rackspace host; n.b. rackspace provided images
470+
# have these Xen tools installed but a custom image may not.
471+
function is_rackspace {
472+
[ -f /usr/bin/xenstore-ls ] && \
473+
sudo /usr/bin/xenstore-ls vm-data | grep -q "Rackspace"
474+
}
475+
469476
# Determine if current distribution is a Fedora-based distribution
470477
# (Fedora, RHEL, CentOS, etc).
471478
# is_fedora

stack.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ if is_ubuntu; then
216216
echo 'APT::Acquire::Retries "20";' | sudo tee /etc/apt/apt.conf.d/80retry
217217
fi
218218

219+
# upstream Rackspace centos7 images have an issue where cloud-init is
220+
# installed via pip because there were not official packages when the
221+
# image was created (fix in the works). Remove all pip packages
222+
# before we do anything else
223+
if [[ $DISTRO = "rhel7" && is_rackspace ]]; then
224+
(sudo pip freeze | xargs sudo pip uninstall -y) || true
225+
fi
226+
219227
# Some distros need to add repos beyond the defaults provided by the vendor
220228
# to pick up required packages.
221229

0 commit comments

Comments
 (0)