53794aad7a
Update charm to execute hooks and actions under Python 3; this includes dealing with upgrades (by switching the upgrade-charm hook to be a bash script which installs the required charm runtime dependencies). This commit also drops code from ceph.py which was used across other ceph charms in the past; only the functions required for this charm have been retained. Change-Id: I5e222d907bfa34ffacad16c51abd1278d7d82f56
18 lines
359 B
Bash
Executable File
18 lines
359 B
Bash
Executable File
#!/bin/bash
|
|
# Install required dependencies for charm runtime
|
|
|
|
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'yaml' 'jinja2' '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
|