summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLiam Young <liam.young@canonical.com>2017-11-27 08:59:56 +0000
committerLiam Young <liam.young@canonical.com>2017-11-27 09:00:36 +0000
commitefd2dbcdd0016c806e61e060478acfaef88f9426 (patch)
tree549d13ea6eb26fb5460602f083c49c39c1e36241
parentc6ae48be4a33fbabe424a002bb5918d2b33f1999 (diff)
downloadcharm-nova-lxd-efd2dbcdd0016c806e61e060478acfaef88f9426.zip
charm-nova-lxd-efd2dbcdd0016c806e61e060478acfaef88f9426.tar.gz
charm-nova-lxd-efd2dbcdd0016c806e61e060478acfaef88f9426.tar.bz2
Install python-apt before hooks run
Previously this charm had relied on python-apt being installed by the principle. As charms migrate to py3 this is no longer a safe assumption and actually never was. This change ensures that python-apt is installed before immediatly. This follows the same pattern Change-Id: I21ca95a9f2e410a52a7b64c99fad85749d52473a
-rwxr-xr-x[l---------]hooks/install21
l---------hooks/install.real1
-rwxr-xr-xhooks/lxd_hooks.py2
3 files changed, 22 insertions, 2 deletions
diff --git a/hooks/install b/hooks/install
index 4a63a15..15dcbe1 120000..100755
--- a/hooks/install
+++ b/hooks/install
@@ -1 +1,20 @@
-lxd_hooks.py \ No newline at end of file
+#!/bin/bash
+# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
+# by default.
+
+declare -a DEPS=('apt')
+
+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
diff --git a/hooks/install.real b/hooks/install.real
new file mode 120000
index 0000000..4a63a15
--- /dev/null
+++ b/hooks/install.real
@@ -0,0 +1 @@
+lxd_hooks.py \ No newline at end of file
diff --git a/hooks/lxd_hooks.py b/hooks/lxd_hooks.py
index 9dc6766..aa27a59 100755
--- a/hooks/lxd_hooks.py
+++ b/hooks/lxd_hooks.py
@@ -59,7 +59,7 @@ from charmhelpers.fetch import (
hooks = Hooks()
-@hooks.hook()
+@hooks.hook('install.real')
def install():
status_set('maintenance', 'Installing LXD packages')
if config('source'):

This mirror site include all the OpenStack related repositories under: openstack, openstack-dev and openstack-infra.

NOTE: All repositories are updated every one hour.

Usage

For Git Clone
 git clone http://git.trystack.cn/openstack/nova.git 
For DevStack

Add GIT_BASE, NOVNC_REPO and SPICE_REPO variables to local.conf file.

[[local|localrc]]

# use TryStack git mirror
GIT_BASE=http://git.trystack.cn
NOVNC_REPO=http://git.trystack.cn/kanaka/noVNC.git
SPICE_REPO=http://git.trystack.cn/git/spice/spice-html5.git