Install python-apt before hooks run
Previously this charm had relied on python-apt being installed by the principle. As charms migrate to py3 this is no longer a safe assumption and actually never was. This change ensures that python-apt is installed before immediatly. This follows the same pattern Change-Id: I21ca95a9f2e410a52a7b64c99fad85749d52473a
This commit is contained in:
parent
c6ae48be4a
commit
efd2dbcdd0
|
@ -1 +0,0 @@
|
|||
lxd_hooks.py
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
|
||||
# by default.
|
||||
|
||||
declare -a DEPS=('apt')
|
||||
|
||||
check_and_install() {
|
||||
pkg="${1}-${2}"
|
||||
if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
|
||||
apt-get -y install ${pkg}
|
||||
fi
|
||||
}
|
||||
|
||||
PYTHON="python"
|
||||
|
||||
for dep in ${DEPS[@]}; do
|
||||
check_and_install ${PYTHON} ${dep}
|
||||
done
|
||||
|
||||
exec ./hooks/install.real
|
|
@ -0,0 +1 @@
|
|||
lxd_hooks.py
|
|
@ -59,7 +59,7 @@ from charmhelpers.fetch import (
|
|||
hooks = Hooks()
|
||||
|
||||
|
||||
@hooks.hook()
|
||||
@hooks.hook('install.real')
|
||||
def install():
|
||||
status_set('maintenance', 'Installing LXD packages')
|
||||
if config('source'):
|
||||
|
|
Loading…
Reference in New Issue