#!/bin/sh

set -eu

apt_get_install() {
    DEBIAN_FRONTEND=noninteractive apt-get -y -qq -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install $@
}

juju-log 'Invoking charm-pre-install hooks'
[ -d exec.d ] && ( for f in exec.d/*/charm-pre-install; do [ -x $f ] && /bin/sh -c "$f"; done )

# Install missing python-yaml library
# GZ: local change, also python-apt which is missing from rackspace images
apt-get install -y python-yaml python-apt

juju-log 'Invoking python-based install hook'
python hooks/hooks.py install
