Use CHARM_DIR instead of a hardcoded path for the charm directory. This makes

the charm compatible with both juju and juju-core.
This commit is contained in:
Andreas Hasenack 2013-04-25 14:02:49 -03:00
parent 5c1d7dfd21
commit bac9d3a41d
2 changed files with 4 additions and 3 deletions

View File

@ -762,7 +762,8 @@ function save_script_rc {
exit 1
fi
# our default unit_path
unit_path="/var/lib/juju/units/${JUJU_UNIT_NAME/\//-}/charm/scripts/scriptrc"
mkdir -p "$CHARM_DIR/scripts"
unit_path="$CHARM_DIR/scripts/scriptrc"
echo $unit_path
tmp_rc="/tmp/${JUJU_UNIT_NAME/\//-}rc"
@ -771,7 +772,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

@ -1 +1 @@
261
262