From bdc90c5f0243e3d2b3efa893cfd080d039fed8e4 Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Mon, 4 Aug 2014 15:44:58 +1000 Subject: [PATCH] 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 --- functions-common | 7 +++++++ stack.sh | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/functions-common b/functions-common index 52840568e9..c09666458f 100644 --- a/functions-common +++ b/functions-common @@ -466,6 +466,13 @@ function is_arch { [[ "$(uname -m)" == "$1" ]] } +# Quick check for a rackspace host; n.b. rackspace provided images +# have these Xen tools installed but a custom image may not. +function is_rackspace { + [ -f /usr/bin/xenstore-ls ] && \ + sudo /usr/bin/xenstore-ls vm-data | grep -q "Rackspace" +} + # Determine if current distribution is a Fedora-based distribution # (Fedora, RHEL, CentOS, etc). # is_fedora diff --git a/stack.sh b/stack.sh index cd7a24f376..33d96ac0f2 100755 --- a/stack.sh +++ b/stack.sh @@ -216,6 +216,14 @@ if is_ubuntu; then echo 'APT::Acquire::Retries "20";' | sudo tee /etc/apt/apt.conf.d/80retry fi +# upstream Rackspace centos7 images have an issue where cloud-init is +# installed via pip because there were not official packages when the +# image was created (fix in the works). Remove all pip packages +# before we do anything else +if [[ $DISTRO = "rhel7" && is_rackspace ]]; then + (sudo pip freeze | xargs sudo pip uninstall -y) || true +fi + # Some distros need to add repos beyond the defaults provided by the vendor # to pick up required packages.