Do not use mktemp for creating rally.conf

File created by mktemp does not have world readable permissons, but
configuration file should be world-readable.

Change-Id: Ie4b7dbdafe96747c679c6b7fa58cd8af3c92078e
Closes-Bug: #1340670
This commit is contained in:
Sergey Skripnick 2014-07-11 13:57:19 +03:00
parent 9e530df605
commit 8de6a6b9ee

View File

@ -134,12 +134,8 @@ install_rally() {
configure_rally() {
mkdir -p ${RALLY_DATABASE_DIR} ${RALLY_CONFIGURATION_DIR}
cp ${TMP}/etc/rally/rally.conf.sample ${RALLY_CONFIGURATION_DIR}/rally.conf
local tmp=$(mktemp /tmp/rally.conf.XXXXX)
sed 's|#connection=<None>|connection=sqlite:///'${RALLY_DATABASE_DIR}'/rally.sqlite|' ${RALLY_CONFIGURATION_DIR}/rally.conf > ${tmp}
mv ${tmp} ${RALLY_CONFIGURATION_DIR}/rally.conf
sed 's|#connection=<None>|connection=sqlite:///'${RALLY_DATABASE_DIR}'/rally.sqlite|' \
${TMP}/etc/rally/rally.conf.sample > ${RALLY_CONFIGURATION_DIR}/rally.conf
rally-manage db recreate
chmod -R go+w ${RALLY_DATABASE_DIR}
}