Browse code

should speed up by 20 seconds - sudo and no sleep

Jesse Andrews authored on 2011/11/07 01:00:28
Showing 2 changed files
... ...
@@ -103,8 +103,7 @@ if [[ $EUID -eq 0 ]]; then
103 103
 
104 104
     # since this script runs as a normal user, we need to give that user
105 105
     # ability to run sudo
106
-    apt_get update
107
-    apt_get install sudo
106
+    dpkg -l sudo || apt_get update && apt_get install sudo
108 107
 
109 108
     if ! getent passwd stack >/dev/null; then
110 109
         echo "Creating a user called stack"
... ...
@@ -171,13 +171,14 @@ EOF
171 171
 cat > $vm_dir/uec/user-data<<EOF
172 172
 #!/bin/bash
173 173
 apt-get update
174
-apt-get install git -y
174
+apt-get install git sudo -y
175 175
 git clone https://github.com/cloudbuilders/devstack.git
176 176
 cd devstack
177 177
 git remote set-url origin `cd $TOP_DIR; git remote show origin | grep Fetch | awk '{print $3}'`
178 178
 git fetch
179 179
 git checkout `git rev-parse HEAD`
180 180
 cat > localrc <<LOCAL_EOF
181
+ROOTSLEEP=0
181 182
 `cat $TOP_DIR/localrc`
182 183
 LOCAL_EOF
183 184
 ./stack.sh