#!/bin/bash

# CONTEXT: GUEST during CONSTRUCTION as ROOT
# PURPOSE: Install trove guest python dependencies - see trovestack functions_qemu

set -e
set -o xtrace

dnf install -y python-devel libxml2-devel libxslt-devel python-setuptools \
    python-sqlalchemy python-lxml \
    python-routes python-eventlet python-webob \
    python-kombu python-paste-deploy python-paste python-netaddr \
    python-httplib2 python-iso8601 python-pip python-mysql \
    python-migrate python-anyjson gcc python-pexpect

# pick up the requirements file left for us by
# extra-data.d/15-reddwarf-dep

TMP_HOOKS_DIR="/tmp/in_target.d"

UPPER_CONSTRAINTS=
if [ -f ${TMP_HOOKS_DIR}/upper-constraints.txt ]; then
    UPPER_CONSTRAINTS=" -c ${TMP_HOOKS_DIR}/upper-constraints.txt"
fi

pip install -q --upgrade -r ${TMP_HOOKS_DIR}/requirements.txt ${UPPER_CONSTRAINTS}

echo "diagnostic pip freeze output follows"
pip freeze
echo "diagnostic pip freeze output above"
