charm-ceph/hooks/install_deps
Chris MacNaughton 15e6c17a72 Add install_deps to ensure python dependencies are installed
Change-Id: I02d3954bfc607a4520e490913e4ad3001deec55b
2016-12-01 13:46:11 -05:00

19 lines
391 B
Bash
Executable File

#!/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