From 12a033e28c573079625a6d35a43cba69de46a759 Mon Sep 17 00:00:00 2001 From: Andreas Hasenack Date: Fri, 26 Apr 2013 10:28:31 -0300 Subject: [PATCH] Use CHARM_DIR --- hooks/cinder-common | 8 +++++--- hooks/cinder-hooks | 8 ++++---- hooks/lib/openstack-common | 4 ++-- revision | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hooks/cinder-common b/hooks/cinder-common index 2e912eee..4eb9e4e1 100755 --- a/hooks/cinder-common +++ b/hooks/cinder-common @@ -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() { diff --git a/hooks/cinder-hooks b/hooks/cinder-hooks index 43450800..21353673 100755 --- a/hooks/cinder-hooks +++ b/hooks/cinder-hooks @@ -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 diff --git a/hooks/lib/openstack-common b/hooks/lib/openstack-common index 77ce75e7..d5b19c5d 100644 --- a/hooks/lib/openstack-common +++ b/hooks/lib/openstack-common @@ -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 diff --git a/revision b/revision index 7273c0fa..6f4247a6 100644 --- a/revision +++ b/revision @@ -1 +1 @@ -25 +26