Add install_deps to ensure python dependencies are installed
Change-Id: I02d3954bfc607a4520e490913e4ad3001deec55b
This commit is contained in:
parent
0b308732e4
commit
15e6c17a72
|
@ -17,4 +17,5 @@ for dep in ${DEPS[@]}; do
|
|||
check_and_install ${PYTHON} ${dep}
|
||||
done
|
||||
|
||||
./hooks/install_deps
|
||||
exec ./hooks/install.real
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#!/bin/bash
|
||||
# Wrapper to ensure that python dependencies are installed before we get into
|
||||
# the python part of the hook execution
|
||||
|
||||
declare -a DEPS=('dnspython' 'pyudev')
|
||||
|
||||
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
|
|
@ -3,4 +3,5 @@
|
|||
# after we upgrade the charm with newer libraries
|
||||
rm -rf **/*.pyc
|
||||
|
||||
./hooks/install_deps
|
||||
exec ./hooks/upgrade-charm.real
|
||||
|
|
Loading…
Reference in New Issue