Browse code

Temporarily pre-create ~stack/.cache for pip 6

* tools/create-stack-user.sh: Add a ~stack/.cache directory owned by
the stack user and group. This is intended as a temporary workaround
to be able to add -H to sudo pip calls in grenade and devstack
stable branches, and can then be reverted once those land.

Change-Id: Ie74130beef13a0d9485bb962d86188bb64cce022
Co-Authored-By: Adam Gandelman <adamg@ubuntu.com>

Jeremy Stanley authored on 2014/12/31 01:06:24
Showing 1 changed files
... ...
@@ -44,6 +44,13 @@ fi
44 44
 if ! getent passwd $STACK_USER >/dev/null; then
45 45
     echo "Creating a user called $STACK_USER"
46 46
     useradd -g $STACK_USER -s /bin/bash -d $DEST -m $STACK_USER
47
+
48
+    # TODO(fungi): Remove after sudo -H pip is used in all supported branches
49
+    #
50
+    # Create user's ~/.cache directory with proper permissions, ensuring later
51
+    # 'sudo pip install's do not create it owned by root.
52
+    mkdir -p ~$STACK_USER/.cache
53
+    chown -R $STACK_USER:$STACK_USER ~$STACK_USER/.cache
47 54
 fi
48 55
 
49 56
 echo "Giving stack user passwordless sudo privileges"