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

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

Description of the change

This branch changes the charm to use CHARM_DIR instead of a hardcoded path. That makes it compatible with both juju-core and juju.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/horizon-common'
--- hooks/horizon-common 2013-03-22 11:23:33 +0000
+++ hooks/horizon-common 2013-04-26 20:49:42 +0000
@@ -5,11 +5,12 @@
55
6PACKAGES="openstack-dashboard python-keystoneclient python-memcache memcached haproxy"6PACKAGES="openstack-dashboard python-keystoneclient python-memcache memcached haproxy"
7LOCAL_SETTINGS="/etc/openstack-dashboard/local_settings.py"7LOCAL_SETTINGS="/etc/openstack-dashboard/local_settings.py"
8HOOKS_DIR="$CHARM_DIR/hooks"
89
9if [[ -e "$CHARM_DIR/lib/openstack-common" ]] ; then10if [[ -e "$HOOKS_DIR/lib/openstack-common" ]] ; then
10 . $CHARM_DIR/lib/openstack-common11 . $HOOKS_DIR/lib/openstack-common
11else12else
12 juju-log "ERROR: Couldn't load $CHARM_DIR/lib/openstack-common." && exit 113 juju-log "ERROR: Couldn't load $HOOKS_DIR/lib/openstack-common." && exit 1
13fi14fi
1415
15set_or_update() {16set_or_update() {
1617
=== modified file 'hooks/horizon-relations'
--- hooks/horizon-relations 2013-04-08 16:17:03 +0000
+++ hooks/horizon-relations 2013-04-26 20:49:42 +0000
@@ -1,13 +1,13 @@
1#!/bin/bash1#!/bin/bash
2set -e2set -e
33
4CHARM_DIR=$(dirname $0)4HOOKS_DIR="$CHARM_DIR/hooks"
5ARG0=${0##*/}5ARG0=${0##*/}
66
7if [[ -e $CHARM_DIR/horizon-common ]] ; then7if [[ -e $HOOKS_DIR/horizon-common ]] ; then
8 . $CHARM_DIR/horizon-common8 . $HOOKS_DIR/horizon-common
9else9else
10 echo "ERROR: Could not load horizon-common from $CHARM_DIR"10 echo "ERROR: Could not load horizon-common from $HOOKS_DIR"
11fi11fi
1212
13function install_hook {13function install_hook {
1414
=== modified file 'hooks/lib/openstack-common'
--- hooks/lib/openstack-common 2013-03-15 18:43:15 +0000
+++ hooks/lib/openstack-common 2013-04-26 20:49:42 +0000
@@ -750,7 +750,7 @@
750 exit 1750 exit 1
751 fi751 fi
752 # our default unit_path752 # our default unit_path
753 unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/scripts/scriptrc"753 unit_path="$CHARM_DIR/scripts/scriptrc"
754 echo $unit_path754 echo $unit_path
755 tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"755 tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
756756
@@ -759,7 +759,7 @@
759 do759 do
760 if `echo $env_var | grep -q script_path`; then760 if `echo $env_var | grep -q script_path`; then
761 # well then we need to reset the new unit-local script path761 # well then we need to reset the new unit-local script path
762 unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/${env_var/script_path=/}"762 unit_path="$CHARM_DIR/${env_var/script_path=/}"
763 else763 else
764 echo "export $env_var" >> $tmp_rc764 echo "export $env_var" >> $tmp_rc
765 fi765 fi
766766
=== modified file 'revision'
--- revision 2013-03-27 14:59:04 +0000
+++ revision 2013-04-26 20:49:42 +0000
@@ -1,1 +1,1 @@
127128

Subscribers

People subscribed via source and target branches