006b3e6228
In order to avoid conflict with installing dependencies for IPA from pypi and distribution packages this patch propose installing IPA in a virtual environment. Closes-Bug: #1506792 Change-Id: I6a4c6403813d86f4110e98449ddd874109101b9e
39 lines
1.1 KiB
Bash
Executable File
39 lines
1.1 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
if [ "${DIB_DEBUG_TRACE:-0}" -gt 0 ]; then
|
|
set -x
|
|
fi
|
|
set -eu
|
|
set -o pipefail
|
|
|
|
SCRIPTDIR=$(dirname $0)
|
|
IPADIR=/usr/share/ironic-python-agent
|
|
|
|
# create the virtual environment
|
|
virtualenv $IPADIR/venv
|
|
|
|
# install IPA inside the virtual environment
|
|
$IPADIR/venv/bin/pip install $IPADIR
|
|
|
|
# FIXME(lucasagomes): Figure out how we can use the "--install-option"
|
|
# parameter for pip install so we don't have to manually create a symlink
|
|
# 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
|
|
upstart)
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.conf /etc/init/ironic-python-agent.conf
|
|
;;
|
|
systemd)
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.service /usr/lib/systemd/system/ironic-python-agent.service
|
|
;;
|
|
sysv)
|
|
install -D -g root -o root -m 0755 ${SCRIPTDIR}/ironic-python-agent.init /etc/init.d/ironic-python-agent.init
|
|
update-rc.d ironic-python-agent.init defaults
|
|
;;
|
|
*)
|
|
echo "Unsupported init system"
|
|
exit 1
|
|
;;
|
|
esac
|