Install python-virtualenv for upgrade script

Since we are going to completely re-factor upgrade scripts approach,
we need to have simple workaround without publishing
python-virtualenv scripts in our updates mirror

Change-Id: I14a5f78b323c1c62a9986b3536ba7dde79ec5fb3
Closes-bug: #1505210
This commit is contained in:
Sergey Kulanov 2015-10-12 18:12:09 +03:00
parent 3303f41f99
commit 8a2ab8a3cc
2 changed files with 29 additions and 2 deletions

View File

@ -10,6 +10,8 @@ all: upgrade-lrzip openstack-yaml
upgrade-lrzip: UPGRADERS ?= "host-system docker openstack"
upgrade-lrzip: $(UPGRADE_TARBALL_PATH).lrz
PYTHON_VIRTUALENV_PKGS:=python-devel-2.6.6-52.el6.x86_64.rpm python-virtualenv-1.11.6-1.mira1.noarch.rpm
########################
# UPGRADE LRZIP ARTIFACT
########################
@ -55,6 +57,15 @@ endif
cd $(BUILD_DIR)/repos/fuel-nailgun/fuel_upgrade_system/fuel_upgrade && $(BUILD_DIR)/upgrade/venv/bin/python setup.py sdist --dist-dir $(BUILD_DIR)/upgrade/deps
$(ACTION.TOUCH)
# FIXME: (skulanov)
# since we don't have python-virtualenv on our release mirror
# and not going to publish it over updates channel
# we need to download and install packages manually
$(addprefix $(BUILD_DIR)/upgrade/,$(PYTHON_VIRTUALENV_PKGS)):
@mkdir -p $(@D)
wget -nv -O $@.tmp http://mirror.fuel-infra.org/fwm/6.1/centos/os/x86_64/Packages/$(@F)
mv $@.tmp $@
# Save pip artifact, if needed
$(BUILD_DIR)/upgrade/$(SAVE_UPGRADE_PIP_ART): $(BUILD_DIR)/upgrade/deps.done
mkdir -p $(@D)
@ -69,9 +80,11 @@ $(ARTS_DIR)/$(SAVE_UPGRADE_PIP_ART): $(BUILD_DIR)/upgrade/$(SAVE_UPGRADE_PIP_ART
########################
$(BUILD_DIR)/upgrade/common-part.tar: \
$(ARTS_DIR)/$(VERSION_YAML_ART_NAME) \
$(BUILD_DIR)/upgrade/deps.done
$(BUILD_DIR)/upgrade/deps.done \
$(addprefix $(BUILD_DIR)/upgrade/,$(PYTHON_VIRTUALENV_PKGS))
mkdir -p $(@D)
rm -f $@
tar rf $@ -C $(BUILD_DIR)/upgrade --xform s:^:upgrade/: $(PYTHON_VIRTUALENV_PKGS)
tar rf $@ -C $(BUILD_DIR)/upgrade --xform s:^:upgrade/: deps
sed 's/{{UPGRADERS}}/${UPGRADERS}/g' $(SOURCE_DIR)/upgrade/upgrade_template.sh > $(BUILD_DIR)/upgrade/upgrade.sh
tar rf $@ --mode=755 -C $(BUILD_DIR)/upgrade upgrade.sh

View File

@ -17,10 +17,24 @@ function error {
}
function install_python-virtualenv ()
{
local pkgs="python-devel-2.6.6-52.el6.x86_64.rpm python-virtualenv-1.11.6-1.mira1.noarch.rpm"
for pkg in $pkgs; do
rpm -i "${UPGRADE_PATH}/${pkg}"
done
}
function prepare_virtualenv {
# FIXME: (skulanov)
# since we don't have python-virtualenv on our release mirror
# and not going to publish it over updates channel
# we need to download and install packages manually
if ! which virtualenv >/dev/null; then
yum -y install python-virtualenv || error "Failed to install python-virtualenv"
install_python-virtualenv || error "Failed to install python-virtualenv"
fi
rm -rf $VIRTUALENV_PATH