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

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

Description of the change

This change makes the charm use CHARM_DIR instead of a hardcoded path for the location of the charm directory. In this way, it can be deployed by both juju and juju-core.

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

Bump revision

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/lib/openstack-common'
2--- hooks/lib/openstack-common 2013-03-18 18:13:07 +0000
3+++ hooks/lib/openstack-common 2013-04-26 21:13:28 +0000
4@@ -750,7 +750,7 @@
5 exit 1
6 fi
7 # our default unit_path
8- unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/scripts/scriptrc"
9+ unit_path="$CHARM_DIR/scripts/scriptrc"
10 echo $unit_path
11 tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
12
13@@ -759,7 +759,7 @@
14 do
15 if `echo $env_var | grep -q script_path`; then
16 # well then we need to reset the new unit-local script path
17- unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/${env_var/script_path=/}"
18+ unit_path="$CHARM_DIR/${env_var/script_path=/}"
19 else
20 echo "export $env_var" >> $tmp_rc
21 fi
22
23=== modified file 'hooks/swift-storage-node-common'
24--- hooks/swift-storage-node-common 2013-01-15 18:40:49 +0000
25+++ hooks/swift-storage-node-common 2013-04-26 21:13:28 +0000
26@@ -2,11 +2,12 @@
27 set -ue
28
29 CHARM="swift-storage"
30+HOOKS_DIR="$CHARM_DIR/hooks"
31
32-if [[ -e "$CHARM_DIR/lib/openstack-common" ]] ; then
33- . $CHARM_DIR/lib/openstack-common
34+if [[ -e "$HOOKS_DIR/lib/openstack-common" ]] ; then
35+ . $HOOKS_DIR/lib/openstack-common
36 else
37- juju-log "ERROR: Couldn't load $CHARM_DIR/lib/openstack-common." && exit 1
38+ juju-log "ERROR: Couldn't load $HOOKS_DIR/lib/openstack-common." && exit 1
39 fi
40
41 DEFAULT_ETH=$(ip route | grep default | awk '{ print $5 }')
42
43=== modified file 'hooks/swift-storage-node-relations'
44--- hooks/swift-storage-node-relations 2013-04-05 20:49:21 +0000
45+++ hooks/swift-storage-node-relations 2013-04-26 21:13:28 +0000
46@@ -2,13 +2,13 @@
47 # test
48 set -eu
49
50-CHARM_DIR=$(dirname $0)
51+HOOKS_DIR="$CHARM_DIR/hooks"
52 ARG0=${0##*/}
53
54-if [[ -e $CHARM_DIR/swift-storage-node-common ]] ; then
55- . $CHARM_DIR/swift-storage-node-common
56+if [[ -e $HOOKS_DIR/swift-storage-node-common ]] ; then
57+ . $HOOKS_DIR/swift-storage-node-common
58 else
59- echo "ERROR: Could not load swift-storage-node-common from $CHARM_DIR"
60+ echo "ERROR: Could not load swift-storage-node-common from $HOOKS_DIR"
61 fi
62
63 function config_changed {
64
65=== modified file 'revision'
66--- revision 2013-04-05 20:49:21 +0000
67+++ revision 2013-04-26 21:13:28 +0000
68@@ -1,1 +1,1 @@
69-57
70+58

Subscribers

People subscribed via source and target branches