diff --git a/hooks/lib/openstack-common b/hooks/lib/openstack-common index a3ecfc1..6942e61 100644 --- a/hooks/lib/openstack-common +++ b/hooks/lib/openstack-common @@ -750,7 +750,7 @@ function save_script_rc { exit 1 fi # our default unit_path - unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/scripts/scriptrc" + unit_path="$CHARM_DIR/scripts/scriptrc" echo $unit_path tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc" @@ -759,7 +759,7 @@ function save_script_rc { do if `echo $env_var | grep -q script_path`; then # well then we need to reset the new unit-local script path - unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/${env_var/script_path=/}" + unit_path="$CHARM_DIR/${env_var/script_path=/}" else echo "export $env_var" >> $tmp_rc fi diff --git a/hooks/swift-storage-node-common b/hooks/swift-storage-node-common index 342f351..1c1d0c6 100755 --- a/hooks/swift-storage-node-common +++ b/hooks/swift-storage-node-common @@ -2,11 +2,12 @@ set -ue CHARM="swift-storage" +HOOKS_DIR="$CHARM_DIR/hooks" -if [[ -e "$CHARM_DIR/lib/openstack-common" ]] ; then - . $CHARM_DIR/lib/openstack-common +if [[ -e "$HOOKS_DIR/lib/openstack-common" ]] ; then + . $HOOKS_DIR/lib/openstack-common else - juju-log "ERROR: Couldn't load $CHARM_DIR/lib/openstack-common." && exit 1 + juju-log "ERROR: Couldn't load $HOOKS_DIR/lib/openstack-common." && exit 1 fi DEFAULT_ETH=$(ip route | grep default | awk '{ print $5 }') diff --git a/hooks/swift-storage-node-relations b/hooks/swift-storage-node-relations index 8487975..7c480cb 100755 --- a/hooks/swift-storage-node-relations +++ b/hooks/swift-storage-node-relations @@ -2,13 +2,13 @@ # test set -eu -CHARM_DIR=$(dirname $0) +HOOKS_DIR="$CHARM_DIR/hooks" ARG0=${0##*/} -if [[ -e $CHARM_DIR/swift-storage-node-common ]] ; then - . $CHARM_DIR/swift-storage-node-common +if [[ -e $HOOKS_DIR/swift-storage-node-common ]] ; then + . $HOOKS_DIR/swift-storage-node-common else - echo "ERROR: Could not load swift-storage-node-common from $CHARM_DIR" + echo "ERROR: Could not load swift-storage-node-common from $HOOKS_DIR" fi function config_changed { diff --git a/revision b/revision index e1617e8..8c61d23 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -57 +58