Update to install python-udev

This is required as it is not a dependency
of charms.ceph

Change-Id: I9dc06c0e3b5fec2c6ed87f61798ed71db03c40fe
Closes-Bug: 1645481
This commit is contained in:
chris 2016-11-28 16:50:23 -05:00
parent 425eec8818
commit 1f4844046e
3 changed files with 21 additions and 1 deletions

View File

@ -2,7 +2,7 @@
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
# by default.
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'dnspython')
declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml')
check_and_install() {
pkg="${1}-${2}"
@ -17,4 +17,5 @@ for dep in ${DEPS[@]}; do
check_and_install ${PYTHON} ${dep}
done
./hooks/install_deps
exec ./hooks/install.real

18
hooks/install_deps Executable file
View File

@ -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

View File

@ -3,4 +3,5 @@
# after we upgrade the charm with newer libraries
rm -rf **/*.pyc
./hooks/install_deps
exec ./hooks/upgrade-charm.real