Merge ahasenack's juju-core compat. patches.
This commit is contained in:
commit
3af89e50d0
@ -750,7 +750,7 @@ function save_script_rc {
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
# our default unit_path
|
# 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
|
echo $unit_path
|
||||||
tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
|
tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
|
||||||
|
|
||||||
@ -759,7 +759,7 @@ function save_script_rc {
|
|||||||
do
|
do
|
||||||
if `echo $env_var | grep -q script_path`; then
|
if `echo $env_var | grep -q script_path`; then
|
||||||
# well then we need to reset the new unit-local script path
|
# 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
|
else
|
||||||
echo "export $env_var" >> $tmp_rc
|
echo "export $env_var" >> $tmp_rc
|
||||||
fi
|
fi
|
||||||
|
@ -2,11 +2,12 @@
|
|||||||
set -ue
|
set -ue
|
||||||
|
|
||||||
CHARM="swift-storage"
|
CHARM="swift-storage"
|
||||||
|
HOOKS_DIR="$CHARM_DIR/hooks"
|
||||||
|
|
||||||
if [[ -e "$CHARM_DIR/lib/openstack-common" ]] ; then
|
if [[ -e "$HOOKS_DIR/lib/openstack-common" ]] ; then
|
||||||
. $CHARM_DIR/lib/openstack-common
|
. $HOOKS_DIR/lib/openstack-common
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
DEFAULT_ETH=$(ip route | grep default | awk '{ print $5 }')
|
DEFAULT_ETH=$(ip route | grep default | awk '{ print $5 }')
|
||||||
|
@ -2,13 +2,13 @@
|
|||||||
# test
|
# test
|
||||||
set -eu
|
set -eu
|
||||||
|
|
||||||
CHARM_DIR=$(dirname $0)
|
HOOKS_DIR="$CHARM_DIR/hooks"
|
||||||
ARG0=${0##*/}
|
ARG0=${0##*/}
|
||||||
|
|
||||||
if [[ -e $CHARM_DIR/swift-storage-node-common ]] ; then
|
if [[ -e $HOOKS_DIR/swift-storage-node-common ]] ; then
|
||||||
. $CHARM_DIR/swift-storage-node-common
|
. $HOOKS_DIR/swift-storage-node-common
|
||||||
else
|
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
|
fi
|
||||||
|
|
||||||
function config_changed {
|
function config_changed {
|
||||||
|
Loading…
Reference in New Issue
Block a user