Merge "Install IPA in a virtual environment"

This commit is contained in:
Jenkins 2016-02-26 16:23:37 +00:00 committed by Gerrit Code Review
commit de4d0392d5
6 changed files with 15 additions and 16 deletions

View File

@ -1,5 +1,6 @@
dhcp-all-interfaces dhcp-all-interfaces
package-installs package-installs
pip-and-virtualenv
pkg-map pkg-map
source-repositories source-repositories
svc-map svc-map

View File

@ -7,27 +7,25 @@ set -eu
set -o pipefail set -o pipefail
SCRIPTDIR=$(dirname $0) SCRIPTDIR=$(dirname $0)
IPADIR=/usr/share/ironic-python-agent
# Install the latest version of pip and setuptools which has some # create the virtual environment
# fixes for building behind proxy. virtualenv $IPADIR/venv
curl -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py
python /tmp/get-pip.py
rm -f /tmp/get-pip.py
pip install -U setuptools
pip install -r /tmp/ironic-python-agent/requirements.txt # install IPA inside the virtual environment
pip install /tmp/ironic-python-agent $IPADIR/venv/bin/pip install $IPADIR
if [ ! -f /usr/bin/ironic-python-agent ]; then # FIXME(lucasagomes): Figure out how we can use the "--install-option"
ln -s /usr/local/bin/ironic-python-agent /usr/bin/ironic-python-agent # parameter for pip install so we don't have to manually create a symlink
fi # create the launcher link so services can use it
ln -s $IPADIR/venv/bin/ironic-python-agent /usr/local/bin/ironic-python-agent
case "$DIB_INIT_SYSTEM" in case "$DIB_INIT_SYSTEM" in
upstart) upstart)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
;; ;;
systemd) systemd)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/$(svc-map ironic-python-agent).service install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
;; ;;
sysv) sysv)
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init

View File

@ -17,4 +17,4 @@ pre-start script
echo Starting Ironic Python Agent echo Starting Ironic Python Agent
end script end script
exec /usr/bin/ironic-python-agent exec /usr/local/bin/ironic-python-agent

View File

@ -12,7 +12,7 @@
NAME=ironic-python-agent NAME=ironic-python-agent
INIT_NAME=/etc/init.d/${NAME} INIT_NAME=/etc/init.d/${NAME}
SCRIPT_NAME=/usr/bin/${NAME} SCRIPT_NAME=/usr/local/bin/${NAME}
[ -x $SCRIPT_NAME ] || exit 0 [ -x $SCRIPT_NAME ] || exit 0

View File

@ -3,7 +3,7 @@ Description=Ironic Python Agent
After=network.target After=network.target
[Service] [Service]
ExecStart=/usr/bin/ironic-python-agent ExecStart=/usr/local/bin/ironic-python-agent
Restart=always Restart=always
RestartSec=30s RestartSec=30s

View File

@ -1 +1 @@
ironic-agent git /tmp/ironic-python-agent https://git.openstack.org/openstack/ironic-python-agent ironic-agent git /usr/share/ironic-python-agent https://git.openstack.org/openstack/ironic-python-agent