Use CHARM_DIR

This commit is contained in:
Andreas Hasenack
2013-04-26 10:28:31 -03:00
parent f7d5063153
commit 12a033e28c
4 changed files with 12 additions and 10 deletions

View File

@@ -12,10 +12,12 @@ API_CONF="/etc/cinder/api-paste.ini"
CONFIG_CHANGED="False"
if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
. $CHARM_DIR/lib/openstack-common
HOOKS_DIR="$CHARM_DIR/hooks"
if [[ -e $HOOKS_DIR/lib/openstack-common ]] ; then
. $HOOKS_DIR/lib/openstack-common
else
juju-log "Couldn't load $CHARM_DIR/openstack-common" && exit 1
juju-log "Couldn't load $HOOKS_DIR/openstack-common" && exit 1
fi
service_enabled() {

View File

@@ -1,10 +1,10 @@
#!/bin/bash -e
CHARM_DIR=$(dirname $0)
if [[ -e $CHARM_DIR/cinder-common ]] ; then
. $CHARM_DIR/cinder-common
HOOKS_DIR="$CHARM_DIR/hooks"
if [[ -e $HOOKS_DIR/cinder-common ]] ; then
. $HOOKS_DIR/cinder-common
else
juju-log "ERROR: Could not source cinder-common from $CHARM_DIR."
juju-log "ERROR: Could not source cinder-common from $HOOKS_DIR."
exit 1
fi

View File

@@ -762,7 +762,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"
@@ -771,7 +771,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 @@
25
26