From 4faa7f927149a5c4ef7a03523f7bc14523cb9baa Mon Sep 17 00:00:00 2001 From: Stuart Mackie Date: Fri, 7 Oct 2016 12:24:58 -0700 Subject: Charms for Contrail 3.1 with Mitaka Change-Id: Id37f3b9743d1974e31fcd7cd9c54be41bb0c47fb Signed-off-by: Stuart Mackie --- charms/trusty/ceilometer/hooks/install | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 charms/trusty/ceilometer/hooks/install (limited to 'charms/trusty/ceilometer/hooks/install') diff --git a/charms/trusty/ceilometer/hooks/install b/charms/trusty/ceilometer/hooks/install new file mode 100755 index 0000000..83a9d3c --- /dev/null +++ b/charms/trusty/ceilometer/hooks/install @@ -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' 'netaddr' 'netifaces' 'pip' 'yaml') + +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 -- cgit