Reorganise etc directory for easier installation
This also means that the install script will install bash-completion for heat. Change-Id: Ib60346c72ce6277951cb51952e359f97be20a1be Signed-off-by: Zane Bitter <zbitter@redhat.com>
This commit is contained in:
parent
a44519774a
commit
55eb1746aa
62
install.sh
62
install.sh
@ -5,41 +5,55 @@ if [[ $EUID -ne 0 ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CONF_DIR=/etc/heat
|
# Install prefix for config files (e.g. "/usr/local").
|
||||||
|
# Leave empty to install into /etc
|
||||||
|
CONF_PREFIX=""
|
||||||
LOG_DIR=/var/log/heat
|
LOG_DIR=/var/log/heat
|
||||||
|
|
||||||
mkdir -p $LOG_DIR
|
|
||||||
mkdir -p $CONF_DIR
|
|
||||||
|
|
||||||
pushd etc > /dev/null
|
install -d $LOG_DIR
|
||||||
|
|
||||||
|
|
||||||
|
archive_file() {
|
||||||
|
local f=$1
|
||||||
|
|
||||||
|
if [ -e $CONF_PREFIX/$f ]; then
|
||||||
|
echo "Archiving configuration file $CONF_PREFIX/$f" >&2
|
||||||
|
mv $CONF_PREFIX/$f $CONF_PREFIX/$f.bak
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# Archive existing heat-api* config files in preparation
|
# Archive existing heat-api* config files in preparation
|
||||||
# for change to heat-api-cfn*, and future use of heat-api*
|
# for change to heat-api-cfn*, and future use of heat-api*
|
||||||
# the OpenStack API
|
# for the OpenStack API.
|
||||||
for ext in '.conf' '-paste.ini'; do
|
archive_file etc/heat/heat-api.conf
|
||||||
heat_api_file="${CONF_DIR}/heat-api${ext}"
|
archive_file etc/heat/heat-api-paste.ini
|
||||||
if [ -e ${heat_api_file} ]; then
|
|
||||||
echo "archiving configuration file ${heat_api_file}"
|
|
||||||
mv $heat_api_file ${heat_api_file}.bak
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
for f in *
|
|
||||||
do
|
install_dir() {
|
||||||
|
local dir=$1
|
||||||
|
local prefix=$2
|
||||||
|
|
||||||
|
for fn in $(ls $dir); do
|
||||||
|
f=$dir/$fn
|
||||||
if [ -d $f ]; then
|
if [ -d $f ]; then
|
||||||
# ignore directories
|
[ -d $prefix/$f ] || install -d $prefix/$f
|
||||||
continue
|
install_dir $f $prefix
|
||||||
elif [ -f $CONF_DIR/$f ]; then
|
elif [ -f $prefix/$f ]; then
|
||||||
echo "not copying over $CONF_DIR/$f"
|
echo "NOT replacing existing config file $prefix/$f" >&2
|
||||||
diff -u $CONF_DIR/$f $f
|
diff -u $prefix/$f $f
|
||||||
elif [ $f = 'heat-engine.conf' ]; then
|
elif [ $fn = 'heat-engine.conf' ]; then
|
||||||
cat $f | sed s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e '/1 "%02x"' /dev/random`/ > $CONF_DIR/$f
|
cat $f | sed s/%ENCRYPTION_KEY%/`hexdump -n 16 -v -e '/1 "%02x"' /dev/random`/ > $prefix/$f
|
||||||
else
|
else
|
||||||
cp $f $CONF_DIR
|
|
||||||
|
echo "Installing $fn in $prefix/$dir" >&2
|
||||||
|
install -m 664 $f $prefix/$dir
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
popd > /dev/null
|
}
|
||||||
|
|
||||||
|
install_dir etc $CONF_PREFIX
|
||||||
|
|
||||||
|
|
||||||
./setup.py install >/dev/null
|
./setup.py install >/dev/null
|
||||||
rm -rf build heat.egg-info
|
rm -rf build heat.egg-info
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user