Use CHARM_DIR
This commit is contained in:
@@ -12,10 +12,12 @@ API_CONF="/etc/cinder/api-paste.ini"
|
|||||||
|
|
||||||
CONFIG_CHANGED="False"
|
CONFIG_CHANGED="False"
|
||||||
|
|
||||||
if [[ -e $CHARM_DIR/lib/openstack-common ]] ; then
|
HOOKS_DIR="$CHARM_DIR/hooks"
|
||||||
. $CHARM_DIR/lib/openstack-common
|
|
||||||
|
if [[ -e $HOOKS_DIR/lib/openstack-common ]] ; then
|
||||||
|
. $HOOKS_DIR/lib/openstack-common
|
||||||
else
|
else
|
||||||
juju-log "Couldn't load $CHARM_DIR/openstack-common" && exit 1
|
juju-log "Couldn't load $HOOKS_DIR/openstack-common" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
service_enabled() {
|
service_enabled() {
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash -e
|
#!/bin/bash -e
|
||||||
|
|
||||||
CHARM_DIR=$(dirname $0)
|
HOOKS_DIR="$CHARM_DIR/hooks"
|
||||||
if [[ -e $CHARM_DIR/cinder-common ]] ; then
|
if [[ -e $HOOKS_DIR/cinder-common ]] ; then
|
||||||
. $CHARM_DIR/cinder-common
|
. $HOOKS_DIR/cinder-common
|
||||||
else
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -762,7 +762,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"
|
||||||
|
|
||||||
@@ -771,7 +771,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
|
||||||
|
|||||||
Reference in New Issue
Block a user