Browse code

Merge remote-tracking branch 'upstream/master'

Dean Troyer authored on 2011/09/17 06:16:49
Showing 2 changed files
... ...
@@ -22,7 +22,8 @@ if [ ! -d proto ]; then
22 22
     git clone https://github.com/cloudbuilders/python-novaclient.git proto/opt/python-novaclient
23 23
     git clone https://github.com/cloudbuilders/keystone.git proto/opt/keystone
24 24
     git clone https://github.com/cloudbuilders/glance.git proto/opt/glance
25
-    wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/tty.tgz
25
+    chroot proto mkdir -p /opt/files
26
+    wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/files/tty.tgz
26 27
 fi
27 28
 
28 29
 cp -pr proto $DEST
... ...
@@ -122,9 +122,13 @@ sudo apt-get install -y -q `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-s
122 122
 # install python requirements
123 123
 sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*`
124 124
 
125
-# git clone only if directory doesn't exist already
125
+# git clone only if directory doesn't exist already.  Since ``DEST`` might not
126
+# be owned by the installation user, we create the directory and change the
127
+# ownership to the proper user.
126 128
 function git_clone {
127 129
     if [ ! -d $2 ]; then
130
+        sudo mkdir $2
131
+        sudo chown `whoami` $2
128 132
         git clone $1 $2
129 133
     fi
130 134
 }
... ...
@@ -408,13 +412,13 @@ screen_it dash "sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/
408 408
 if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
409 409
     # Downloads a tty image (ami/aki/ari style), then extracts it.  Upon extraction 
410 410
     # we upload to glance with the glance cli tool.
411
-    mkdir -p $DEST/images
412
-    cd $DEST/images
413
-    if [ ! -f $DEST/tty.tgz ]; then
414
-        wget -c http://images.ansolabs.com/tty.tgz -O $DEST/tty.tgz
411
+    if [ ! -f $FILES/tty.tgz ]; then
412
+        wget -c http://images.ansolabs.com/tty.tgz -O $FILES/tty.tgz
415 413
     fi
416 414
 
417 415
     # extract ami-tty/image, aki-tty/image & ari-tty/image
416
+    mkdir -p $FILES/images
417
+    cd $FILES/images
418 418
     tar -zxf $DEST/tty.tgz
419 419
 
420 420
     # add images to glance