Fix permissions for tempest.conf

The current script uses 'sudo' to copy tempest.conf.sample and thus
the .conf file gets owned by root.  It then makes the permissions 644,
meaning that when the 'stack' user does the iniset() calls, it doesn't
have permisson on the .conf file.

Since the dir has been chowned to the stack user, it seems safe to
just copy the sample file in without sudo.  In addition, I moved the
$TEMPEST_CONFIG_DIR creation closer to the copy to make it clearer
what's going on.

Seems to be related to dc4dc7f03335e26ea3d86b6184f0475cc5f3d51b

Fixes bug: #1284378
Change-Id: I103b4e90cbcfa693c9cef319f4135868a1b83de3
This commit is contained in:
Ian Wienand 2014-02-24 15:40:42 +11:00
parent f1eb0475d9
commit 5f90fc06f5

View File

@ -87,11 +87,6 @@ function configure_tempest() {
local boto_instance_type="m1.tiny"
local ssh_connect_method="fixed"
if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
sudo mkdir -p $TEMPEST_CONFIG_DIR
fi
sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
# TODO(afazekas):
# sudo python setup.py deploy
@ -142,8 +137,12 @@ function configure_tempest() {
# Create tempest.conf from tempest.conf.sample
# copy every time, because the image UUIDS are going to change
sudo cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
sudo chmod 644 $TEMPEST_CONFIG
if [[ ! -d $TEMPEST_CONFIG_DIR ]]; then
sudo mkdir -p $TEMPEST_CONFIG_DIR
fi
sudo chown $STACK_USER $TEMPEST_CONFIG_DIR
cp $TEMPEST_DIR/etc/tempest.conf.sample $TEMPEST_CONFIG
chmod 644 $TEMPEST_CONFIG
password=${ADMIN_PASSWORD:-secrete}