charm-heat/hooks/upgrade-charm
Alex Kavanagh 98de623820 Policyd override implementation
This patchset implements policy overrides for heat.  It uses the
code in charmhelpers.

It also fixes a bug in the actions/domain-setup where it assumes that
the python2 version of openstackclient should be installed, and corrects
this via code in hooks/install and hooks/upgrade-charm.

A sync of charm-helpers is included to bring the latest policyd changes
through to the charm.

func-test-pr: https://github.com/openstack-charmers/zaza-openstack-tests/pull/111

Change-Id: Ia607dc9120cfb03902efb019041b43cf12ade2d3
Closed-Bug: #1741723
2019-11-06 16:12:34 +00:00

31 lines
793 B
Bash
Executable File

#!/bin/bash -e
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
# by default.
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'dnspython' 'openstackclient')
# drop this when trusty support is ended. Only need python3 at that point
release=$(lsb_release -c -s)
if [ "$release" == "trusty" ]; then
PYTHON="python"
else
PYTHON="python3"
# if python-openstackclient is installed then remove it
if dpkg -s python-openstackclient 2>&1 > /dev/null; then
apt purge -y python-openstackclient
fi
fi
check_and_install() {
pkg="${1}-${2}"
if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
apt-get -y install ${pkg}
fi
}
for dep in ${DEPS[@]}; do
check_and_install ${PYTHON} ${dep}
done
exec ./hooks/upgrade-charm.real