Install os-apply-config in a virtualenv.

Due to the older python distribute still shipping on Fedora, Ubuntu,
and other distros, os-apply-config can not be installed with pip
install -U.  This change installs os-apply-config in a virtualenv
instead, so that it's in an isolated environment.  os-apply-config and
os-config-applier are symlinked under /usr/local/bin so that all calls
continue to work.

Change-Id: I50d7147cf74a36bbe7751d545c353ac354bdd189
This commit is contained in:
James Slagle 2013-08-02 16:23:02 -04:00
parent 3482706b3a
commit c2c56f86cb
1 changed files with 8 additions and 2 deletions

View File

@ -1,8 +1,14 @@
#!/bin/bash
set -eux
install-packages python-pip
install-packages python-pip python-virtualenv
virtualenv --setuptools /opt/stack/venvs/os-apply-config
/opt/stack/venvs/os-apply-config/bin/pip install -U os-apply-config
ln -s /opt/stack/venvs/os-apply-config/bin/os-apply-config /usr/local/bin/os-apply-config
ln -s /opt/stack/venvs/os-apply-config/bin/os-config-applier /usr/local/bin/os-config-applier
pip install -U os-apply-config
TEMPLATE_ROOT=$(os-apply-config --print-templates)
mkdir -p $TEMPLATE_ROOT