Merge ahasenack's juju-core compat. patches.

This commit is contained in:
Adam Gandelman 2013-04-26 14:44:33 -07:00
commit 3af89e50d0
4 changed files with 11 additions and 10 deletions

View File

@ -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

View File

@ -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 }')

View File

@ -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 {

View File

@ -1 +1 @@
57
58