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 as other charms by adding an install and install.real files. Change-Id: I9fe2a031df736b867d4f277448a4d8649fa8de64
This commit is contained in:
parent
c744a97fb4
commit
d73568eb13
@ -52,7 +52,7 @@ hooks = Hooks()
|
|||||||
CONFIGS = register_configs()
|
CONFIGS = register_configs()
|
||||||
|
|
||||||
|
|
||||||
@hooks.hook()
|
@hooks.hook('install.real')
|
||||||
def install():
|
def install():
|
||||||
origin = config('openstack-origin')
|
origin = config('openstack-origin')
|
||||||
configure_installation_source(origin)
|
configure_installation_source(origin)
|
||||||
|
@ -1 +0,0 @@
|
|||||||
ceilometer_hooks.py
|
|
18
hooks/install
Executable file
18
hooks/install
Executable file
@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
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
|
1
hooks/install.real
Symbolic link
1
hooks/install.real
Symbolic link
@ -0,0 +1 @@
|
|||||||
|
ceilometer_hooks.py
|
Loading…
Reference in New Issue
Block a user