Install murano-agent to pip default location

During package build murano-agent was installed into /opt/stack/<smthg>
directory. This causes problems with the new way of how agent is
detected by murano.
Related-Bug: #1570962
Change-Id: I3dbacb03243d462e9f688e502deec07e33490b30
This commit is contained in:
Nikolay Starodubtsev 2016-05-11 14:09:00 +03:00 committed by Nikolay Starodubtsev
parent b6b6c80a8e
commit 4c28db2e9c
3 changed files with 12 additions and 10 deletions

View File

@ -2,11 +2,10 @@
set -eu
install-packages git-core wget make gcc python-pip python-dev python-setuptools python-virtualenv chef puppet
install-packages git-core wget make gcc python-pip python-dev python-setuptools chef puppet
name=murano-agent
svc_root=${DIB_MURANO_AGENT_SVC_ROOT:-/opt/stack/$name}
install_dir=${DIB_MURANO_AGENT_INSTALL_DIR:-/opt/stack/venvs/$name}
repo=${DIB_MURANO_AGENT_REPO:-git://git.openstack.org/openstack/murano-agent.git}
branch=${DIB_MURANO_AGENT_BRANCH:-master}
ref=${DIB_MURANO_AGENT_REF:-''}
@ -20,15 +19,19 @@ if [ -n "$ref" ]; then
popd
fi
# install murano-agent into virtualenv at /ops/stack/venvs/murano-agent
virtualenv $install_dir
$install_dir/bin/pip install $svc_root
# install murano-agent to default location using pip
# FIXME(starodubcevna): probably pip is not the best case for this. I suggest to
# switch to package when they will be available to all supported distros.
pip install $svc_root
# setup config file at /etc/murano/agent.conf
mkdir -p /etc/murano
PATH="/usr/local/bin:/usr/bin:$PATH"
pushd ${svc_root}
${install_dir}/bin/oslo-config-generator --config-file ${svc_root}/etc/oslo-config-generator/muranoagent.conf
oslo-config-generator --config-file ${svc_root}/etc/oslo-config-generator/muranoagent.conf
popd
cp ${svc_root}/etc/muranoagent/muranoagent.conf.sample /etc/murano/agent.conf.sample
@ -40,4 +43,3 @@ fi
if [ -d "/etc/systemd/system/" ]; then
install -D -g root -o root -m 0755 $(dirname $0)/murano-agent.service /etc/systemd/system/
fi

View File

@ -9,6 +9,6 @@ respawn limit 2 5
# We're logging to syslog
console none
exec start-stop-daemon --start -c root --exec /opt/stack/venvs/murano-agent/bin/muranoagent -- --config-dir /etc/murano 2>&1 | logger -t murano-agent
exec start-stop-daemon --start -c root --exec /usr/local/bin/muranoagent -- --config-dir /etc/murano 2>&1 | logger -t murano-agent
post-start exec sleep 1
post-start exec sleep 1

View File

@ -3,7 +3,7 @@ Description=OpenStack Murano Agent
[Service]
Type=simple
ExecStart=/opt/stack/venvs/murano-agent/bin/muranoagent --config-dir /etc/murano
ExecStart=/usr/local/bin/muranoagent --config-dir /etc/murano
Restart=on-failure
[Install]