diff options
author | carey.xu <carey.xuhan@huawei.com> | 2016-01-27 11:21:41 +0800 |
---|---|---|
committer | carey xu <carey.xuhan@huawei.com> | 2016-01-27 03:29:08 +0000 |
commit | ea87da8bdf478253bcbb6dc1ab1a5b8d2e17e613 (patch) | |
tree | 50c35ffe4d399ac90f0cdb8826112eb6767f56f5 /deploy/prepare.sh | |
parent | a9dc63004652d5ea7fa57714d06cfb1b6a9586e2 (diff) |
bugfix: prepare python venv
JIRA: bugfix_python_env
Change-Id: Ie7f3e295c7c283ff3e805bed13029174c2dda258
Signed-off-by: carey.xu <carey.xuhan@huawei.com>
Diffstat (limited to 'deploy/prepare.sh')
-rwxr-xr-x | deploy/prepare.sh | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/deploy/prepare.sh b/deploy/prepare.sh index db410917..a85be6fb 100755 --- a/deploy/prepare.sh +++ b/deploy/prepare.sh @@ -33,19 +33,14 @@ function prepare_env() { sudo apt-get install -y --force-yes mkisofs bc curl ipmitool openvswitch-switch sudo apt-get install -y --force-yes git python-dev sudo apt-get install -y --force-yes libxslt-dev libxml2-dev libvirt-dev build-essential qemu-utils qemu-kvm libvirt-bin virtinst libmysqld-dev - sudo pip install --upgrade ansible==1.9.4 - sudo pip install --upgrade virtualenv - sudo pip install --upgrade netaddr - sudo apt-get install python-oslo.config sudo service libvirt-bin restart # prepare work dir - rm -rf $WORK_DIR/{installer,vm,network,iso,venv} + rm -rf $WORK_DIR/{installer,vm,network,iso} mkdir -p $WORK_DIR/installer mkdir -p $WORK_DIR/vm mkdir -p $WORK_DIR/network mkdir -p $WORK_DIR/iso - mkdir -p $WORK_DIR/venv mkdir -p $WORK_DIR/cache download_iso @@ -61,7 +56,24 @@ function prepare_env() { rm -rf $WORK_DIR/mnt chmod 755 $WORK_DIR -R - virtualenv $WORK_DIR/venv sudo cp ${COMPASS_DIR}/deploy/qemu_hook.sh /etc/libvirt/hooks/qemu } + +function prepare_python_env() { + rm -rf $WORK_DIR/venv + mkdir -p $WORK_DIR/venv + + sudo apt-get install -y --force-yes python-pip + sudo pip install --upgrade virtualenv + virtualenv $WORK_DIR/venv + source $WORK_DIR/venv/bin/activate + + pip install --upgrade pip + pip install --upgrade cheetah + pip install --upgrade pyyaml + pip install --upgrade requests + pip install --upgrade netaddr + pip install --upgrade oslo.config + pip install --upgrade ansible==1.9.4 +} |