Put charm into its own venv

This adds the venv option to the layer configuration and removes the
custom install hook as it's no longer needed.
This commit is contained in:
Alex Kavanagh 2016-07-13 13:43:53 +00:00
parent c7367af5ec
commit 8fe19c4a3d
3 changed files with 4 additions and 44 deletions

View File

@ -1,25 +0,0 @@
#!/bin/bash
# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
# by default.
check_and_install() {
pkg="${1}"
if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
apt-get -y install ${pkg}
fi
}
status-set maintenance "Install hook running"
juju-log "Installing tox"
check_and_install 'tox'
declare -a DEPS=('libssl-dev' 'libffi-dev' 'apt' 'python3-netaddr' 'python3-netifaces' 'python3-pip' 'python3-yaml' 'python-cinderclient' 'python-glanceclient' 'python-heatclient' 'python-keystoneclient' 'python-neutronclient' 'python-novaclient' 'python-swiftclient' 'python-ceilometerclient' 'openvswitch-test' 'python3-cinderclient' 'python3-glanceclient' 'python3-heatclient' 'python3-keystoneclient' 'python3-neutronclient' 'python3-novaclient' 'python3-swiftclient' 'python3-ceilometerclient')
PYTHON="python"
for dep in ${DEPS[@]}; do
check_and_install ${dep}
done
exec ./hooks/install.real

View File

@ -1,19 +0,0 @@
#!/usr/bin/env python3
# Load modules from $CHARM_DIR/lib
import sys
sys.path.append('lib')
from charms.layer import basic
basic.bootstrap_charm_deps()
basic.init_config_states()
# This will load and run the appropriate @hook and other decorated
# handlers from $CHARM_DIR/reactive, $CHARM_DIR/hooks/reactive,
# and $CHARM_DIR/hooks/relations.
#
# See https://jujucharms.com/docs/stable/authors-charm-building
# for more information on this pattern.
from charms.reactive import main
main()

View File

@ -4,4 +4,8 @@ includes:
- interface:rabbitmq - interface:rabbitmq
- interface:keystone - interface:keystone
- interface:barbican-hsm-plugin - interface:barbican-hsm-plugin
options:
basic:
use_venv: True
include_system_packages: True
repo: git@github.com:openstack-charmers/charm-barbican.git repo: git@github.com:openstack-charmers/charm-barbican.git