Merge lp:~ahasenack/charms/precise/glance/use-charm-dir into lp:~openstack-charmers/charms/precise/glance/ha-support

Proposed by Andreas Hasenack
Status: Merged
Merged at revision: 51
Proposed branch: lp:~ahasenack/charms/precise/glance/use-charm-dir
Merge into: lp:~openstack-charmers/charms/precise/glance/ha-support
Diff against target: 71 lines (+11/-10)
4 files modified
hooks/glance-common (+4/-3)
hooks/glance-relations (+4/-4)
hooks/lib/openstack-common (+2/-2)
revision (+1/-1)
To merge this branch: bzr merge lp:~ahasenack/charms/precise/glance/use-charm-dir
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+161019@code.launchpad.net

Description of the change

This branch makes it possible to deploy glance using both juju-core and juju by using the CHARM_DIR environment variable instead of relying on a hardcoded path. This path changed between juju and juju-core, hence the bug.

To post a comment you must log in.
50. By Andreas Hasenack

Merged with upstream

51. By Andreas Hasenack

typo

52. By Andreas Hasenack

revision

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/glance-common'
2--- hooks/glance-common 2013-04-04 23:34:08 +0000
3+++ hooks/glance-common 2013-04-26 21:12:28 +0000
4@@ -10,13 +10,14 @@
5 GLANCE_API_CONF="/etc/glance/glance-api.conf"
6 GLANCE_API_PASTE_INI="/etc/glance/glance-api-paste.ini"
7 CONF_DIR="/etc/glance"
8+HOOKS_DIR="$CHARM_DIR/hooks"
9
10 # Flag used to track config changes.
11 CONFIG_CHANGED="False"
12-if [[ -e "$CHARM_DIR/lib/openstack-common" ]] ; then
13- . $CHARM_DIR/lib/openstack-common
14+if [[ -e "$HOOKS_DIR/lib/openstack-common" ]] ; then
15+ . $HOOKS_DIR/lib/openstack-common
16 else
17- juju-log "ERROR: Couldn't load $CHARM_DIR/lib/openstack-common." && exit 1
18+ juju-log "ERROR: Couldn't load $HOOKS_DIR/lib/openstack-common." && exit 1
19 fi
20
21 function set_paste_deploy_flavor {
22
23=== modified file 'hooks/glance-relations'
24--- hooks/glance-relations 2013-04-04 23:34:08 +0000
25+++ hooks/glance-relations 2013-04-26 21:12:28 +0000
26@@ -1,12 +1,12 @@
27 #!/bin/bash -e
28
29-CHARM_DIR=$(dirname $0)
30+HOOKS_DIR="$CHARM_DIR/hooks"
31 ARG0=${0##*/}
32
33-if [[ -e $CHARM_DIR/glance-common ]] ; then
34- . $CHARM_DIR/glance-common
35+if [[ -e $HOOKS_DIR/glance-common ]] ; then
36+ . $HOOKS_DIR/glance-common
37 else
38- echo "ERROR: Could nto load glance-common from $CHARM_DIR"
39+ echo "ERROR: Could not load glance-common from $HOOKS_DIR"
40 fi
41
42 function install_hook {
43
44=== modified file 'hooks/lib/openstack-common'
45--- hooks/lib/openstack-common 2013-04-04 23:34:08 +0000
46+++ hooks/lib/openstack-common 2013-04-26 21:12:28 +0000
47@@ -762,7 +762,7 @@
48 exit 1
49 fi
50 # our default unit_path
51- unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/scripts/scriptrc"
52+ unit_path="$CHARM_DIR/scripts/scriptrc"
53 echo $unit_path
54 tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
55
56@@ -771,7 +771,7 @@
57 do
58 if `echo $env_var | grep -q script_path`; then
59 # well then we need to reset the new unit-local script path
60- unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/${env_var/script_path=/}"
61+ unit_path="$CHARM_DIR/${env_var/script_path=/}"
62 else
63 echo "export $env_var" >> $tmp_rc
64 fi
65
66=== modified file 'revision'
67--- revision 2013-04-04 23:34:08 +0000
68+++ revision 2013-04-26 21:12:28 +0000
69@@ -1,1 +1,1 @@
70-140
71+141

Subscribers

People subscribed via source and target branches