db8ba4d938
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
19 lines
342 B
Bash
Executable File
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
|