Merge lp:~deej/charms/xenial/glance-simplestreams-sync/xenial-python-fix into lp:~openstack-charmers-next/charms/xenial/glance-simplestreams-sync/trunk

Proposed by David Lawson
Status: Rejected
Rejected by: James Page
Proposed branch: lp:~deej/charms/xenial/glance-simplestreams-sync/xenial-python-fix
Merge into: lp:~openstack-charmers-next/charms/xenial/glance-simplestreams-sync/trunk
Diff against target: 38 lines (+21/-1)
2 files modified
hooks/hooks.py (+1/-1)
hooks/install (+20/-0)
To merge this branch: bzr merge lp:~deej/charms/xenial/glance-simplestreams-sync/xenial-python-fix
Reviewer Review Type Date Requested Status
OpenStack Charmers - Testing Charms Pending
Review via email: mp+305272@code.launchpad.net

Description of the change

Work around the lack of python2.7 in Xenial as James Page did for mysql, etc.

To post a comment you must log in.
Revision history for this message
James Page (james-page) wrote :

Actually I fixed this earlier in the week with a load of other proposed branches against the trunk branch of this charm - the version in the charmstore should now be published and support xenial.

59. By David Lawson

Add install.real hook link

Revision history for this message
James Page (james-page) wrote :

I need to clear up all of our old cs injestion branches to avoid target confusion methinks.

Unmerged revisions

59. By David Lawson

Add install.real hook link

58. By David Lawson

Add workaround forlack of python2.7 on xenial

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/hooks.py'
2--- hooks/hooks.py 2016-01-18 14:31:12 +0000
3+++ hooks/hooks.py 2016-09-08 20:37:03 +0000
4@@ -185,7 +185,7 @@
5 configs.write(ID_CONF_FILE_NAME)
6
7
8-@hooks.hook('install')
9+@hooks.hook('install.real')
10 def install():
11 execd_preinstall()
12 for directory in [CONF_FILE_DIR, USR_SHARE_DIR]:
13
14=== modified symlink 'hooks/install' (properties changed: -x to +x)
15=== target was u'hooks.py'
16--- hooks/install 1970-01-01 00:00:00 +0000
17+++ hooks/install 2016-09-08 20:37:03 +0000
18@@ -0,0 +1,20 @@
19+#!/bin/bash
20+# Wrapper to deal with newer Ubuntu versions that don't have py2 installed
21+# by default.
22+
23+declare -a DEPS=('apt' 'netaddr' 'netifaces' 'pip' 'yaml' 'six')
24+
25+check_and_install() {
26+ pkg="${1}-${2}"
27+ if ! dpkg -s ${pkg} 2>&1 > /dev/null; then
28+ apt-get -y install ${pkg}
29+ fi
30+}
31+
32+PYTHON="python"
33+
34+for dep in ${DEPS[@]}; do
35+ check_and_install ${PYTHON} ${dep}
36+done
37+
38+exec ./hooks/install.real

Subscribers

People subscribed via source and target branches