charm-nova-compute/hooks/upgrade-charm
Alex Kavanagh db8ba4d938 Ensure that all packaged python deps are installed on upgrade
The referenced bug indicates that if the charm upgrades on a previous
py2 version of the charm then the upgrade fails due to a missing package
(in this python3-yaml).  This patchset ensures that the python3 versions
of the dependency packages are installed.

Change-Id: I8b07de3b2f950237518c0555db1288f9b2c0aabf
Closes-Bug: #1746650
2019-11-29 15:25:26 +00:00

19 lines
342 B
Bash
Executable File

#!/bin/bash -e
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'dnspython')
check_and_install() {
pkg="${1}-${2}"
if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
apt-get -y install ${pkg}
fi
}
PYTHON="python3"
for dep in ${DEPS[@]}; do
check_and_install ${PYTHON} ${dep}
done
exec ./hooks/upgrade-charm.real