Create the stack users ~./cache early

This creates the users ~/.cache directory with proper permissions
prior to running devstack/grenade, avoiding potential permission
issues if a later pip installation is run with sudo but without -H.

Change-Id: I033fd8a28ed593da343315b6fc5a7658ca8c4e31
Related-bug: #1405626
This commit is contained in:
Adam Gandelman
2014-12-29 23:02:21 -08:00
committed by Jeremy Stanley
parent fc2f47df1e
commit 6de39b6eba

View File

@@ -443,6 +443,11 @@ function setup_host {
sudo chown root:root $TEMPFILE
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh
# Create user's ~/.cache directory with proper permissions, ensuring later
# 'sudo pip install's do not create it owned by root.
sudo mkdir -p $BASE/new/.cache
sudo chown -R stack:stack $BASE/new/.cache
# Create a tempest user for tempest to run as, so that we can
# revoke sudo permissions from that user when appropriate.
# NOTE(sdague): we should try to get the state dump to be a