From d61db8597fa01ae9a13f46e1ad7f0360c40774bf Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Fri, 16 Sep 2011 14:13:17 -0700 Subject: [PATCH 1/2] clone to a directory owned by correct user --- stack.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stack.sh b/stack.sh index 93b665abea..b89a3b107d 100755 --- a/stack.sh +++ b/stack.sh @@ -122,9 +122,13 @@ sudo apt-get install -y -q `cat $FILES/apts/* | cut -d\# -f1 | grep -Ev "mysql-s # install python requirements sudo PIP_DOWNLOAD_CACHE=/var/cache/pip pip install `cat $FILES/pips/*` -# git clone only if directory doesn't exist already +# git clone only if directory doesn't exist already. Since ``DEST`` might not +# be owned by the installation user, we create the directory and change the +# ownership to the proper user. function git_clone { if [ ! -d $2 ]; then + sudo mkdir $2 + sudo chown `whoami` $2 git clone $1 $2 fi } From 543d7d44e9ec02a7e4f7371148628236a7649235 Mon Sep 17 00:00:00 2001 From: Jesse Andrews Date: Fri, 16 Sep 2011 14:16:36 -0700 Subject: [PATCH 2/2] don't download images to /opt --- build_nfs.sh | 3 ++- stack.sh | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/build_nfs.sh b/build_nfs.sh index 180a6e5a10..59a3609ad9 100755 --- a/build_nfs.sh +++ b/build_nfs.sh @@ -22,7 +22,8 @@ if [ ! -d proto ]; then git clone https://github.com/cloudbuilders/python-novaclient.git proto/opt/python-novaclient git clone https://github.com/cloudbuilders/keystone.git proto/opt/keystone git clone https://github.com/cloudbuilders/glance.git proto/opt/glance - wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/tty.tgz + chroot proto mkdir -p /opt/files + wget -c http://images.ansolabs.com/tty.tgz -O proto/opt/files/tty.tgz fi cp -pr proto $DEST diff --git a/stack.sh b/stack.sh index b89a3b107d..b47729e190 100755 --- a/stack.sh +++ b/stack.sh @@ -412,13 +412,13 @@ screen_it dash "sudo /etc/init.d/apache2 restart; sudo tail -f /var/log/apache2/ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then # Downloads a tty image (ami/aki/ari style), then extracts it. Upon extraction # we upload to glance with the glance cli tool. - mkdir -p $DEST/images - cd $DEST/images - if [ ! -f $DEST/tty.tgz ]; then - wget -c http://images.ansolabs.com/tty.tgz -O $DEST/tty.tgz + if [ ! -f $FILES/tty.tgz ]; then + wget -c http://images.ansolabs.com/tty.tgz -O $FILES/tty.tgz fi # extract ami-tty/image, aki-tty/image & ari-tty/image + mkdir -p $FILES/images + cd $FILES/images tar -zxf $DEST/tty.tgz # add images to glance