slightly modified install to avoid possible problems if auto-installation doesn't work.

This commit is contained in:
Xinyuan Huang 2014-06-20 18:30:30 -07:00
parent 1359b30a24
commit 250901dbcd
1 changed files with 7 additions and 3 deletions

View File

@ -87,15 +87,19 @@ if [ $? -ne 0 ] ; then
fi
echo "updating config file..."
sed -i .backup -e "/scheduler_driver *=/d" "${_NOVA_CONF_DIR}/${_NOVA_CONF_FILE}"
sed -i .backup -e "/\[DEFAULT\]/a \\
sed -i.backup -e "/scheduler_driver *=/d" "${_NOVA_CONF_DIR}/${_NOVA_CONF_FILE}"
sed -i -e "/\[DEFAULT\]/a \\
scheduler_driver=nova.scheduler.solver_scheduler.ConstraintSolverScheduler" "${_NOVA_CONF_DIR}/${_NOVA_CONF_FILE}"
if [ $? -ne 0 ] ; then
echo "Error in updating, aborted."
echo "Recovering original files..."
cp -r "${_BACKUP_DIR}/nova" `dirname ${_NOVA_DIR}` && rm -r "${_BACKUP_DIR}/nova"
if [ $? -ne 0 ] ; then
echo "Recovering /nova failed! Please install manually."
fi
cp "${_BACKUP_DIR}/etc/nova/${_NOVA_CONF_FILE}" "${_NOVA_CONF_DIR}" && rm -r "${_BACKUP_DIR}/etc"
if [ $? -ne 0 ] ; then
echo "Recovering failed! Please install manually."
echo "Recovering config failed! Please install manually."
fi
exit 1
fi