Browse code

working now

termie authored on 2012/01/12 07:31:59
Showing 1 changed files
... ...
@@ -1372,7 +1372,7 @@ fi
1372 1372
 
1373 1373
 # launch the keystone and wait for it to answer before continuing
1374 1374
 if [[ "$ENABLED_SERVICES" =~ "key" ]]; then
1375
-    screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF $KEYSTONE_LOG_CONFIG -d"
1375
+    screen_it key "cd $KEYSTONE_DIR && $KEYSTONE_DIR/bin/keystone --config-file $KEYSTONE_CONF $KEYSTONE_LOG_CONFIG -d --debug"
1376 1376
     echo "Waiting for keystone to start..."
1377 1377
     if ! timeout $SERVICE_TIMEOUT sh -c "while ! http_proxy= wget -q -O- $KEYSTONE_SERVICE_PROTOCOL://$KEYSTONE_SERVICE_HOST:$KEYSTONE_SERVICE_PORT/v2.0/; do sleep 1; done"; then
1378 1378
       echo "keystone did not start"
... ...
@@ -1532,6 +1532,10 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
1532 1532
     # Create a directory for the downloaded image tarballs.
1533 1533
     mkdir -p $FILES/images
1534 1534
 
1535
+    ADMIN_USER=admin
1536
+    ADMIN_TENANT=admin
1537
+    TOKEN=`curl -s -d  "{\"auth\":{\"passwordCredentials\": {\"username\": \"$ADMIN_USER\", \"password\": \"$ADMIN_PASSWORD\"}, \"tenantName\": \"$ADMIN_TENANT\"}}" -H "Content-type: application/json" http://$HOST_IP:5000/v2.0/tokens | python -c "import sys; import json; tok = json.loads(sys.stdin.read()); print tok['access']['token']['id'];"`
1538
+
1535 1539
     # Option to upload legacy ami-tty, which works with xenserver
1536 1540
     if [ $UPLOAD_LEGACY_TTY ]; then
1537 1541
         if [ ! -f $FILES/tty.tgz ]; then
... ...
@@ -1539,11 +1543,11 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
1539 1539
         fi
1540 1540
 
1541 1541
         tar -zxf $FILES/tty.tgz -C $FILES/images
1542
-        RVAL=`glance add -A $SERVICE_TOKEN name="tty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/aki-tty/image`
1542
+        RVAL=`glance add -A $TOKEN name="tty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/aki-tty/image`
1543 1543
         KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
1544
-        RVAL=`glance add -A $SERVICE_TOKEN name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < $FILES/images/ari-tty/image`
1544
+        RVAL=`glance add -A $TOKEN name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < $FILES/images/ari-tty/image`
1545 1545
         RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
1546
-        glance add -A $SERVICE_TOKEN name="tty" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID ramdisk_id=$RAMDISK_ID < $FILES/images/ami-tty/image
1546
+        glance add -A $TOKEN name="tty" is_public=true container_format=ami disk_format=ami kernel_id=$KERNEL_ID ramdisk_id=$RAMDISK_ID < $FILES/images/ami-tty/image
1547 1547
     fi
1548 1548
 
1549 1549
     for image_url in ${IMAGE_URLS//,/ }; do
... ...
@@ -1590,14 +1594,14 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
1590 1590
         # kernel for use when uploading the root filesystem.
1591 1591
         KERNEL_ID=""; RAMDISK_ID="";
1592 1592
         if [ -n "$KERNEL" ]; then
1593
-            RVAL=`glance add -A $SERVICE_TOKEN name="$IMAGE_NAME-kernel" is_public=true container_format=aki disk_format=aki < "$KERNEL"`
1593
+            RVAL=`glance add -A $TOKEN name="$IMAGE_NAME-kernel" is_public=true container_format=aki disk_format=aki < "$KERNEL"`
1594 1594
             KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
1595 1595
         fi
1596 1596
         if [ -n "$RAMDISK" ]; then
1597
-            RVAL=`glance add -A $SERVICE_TOKEN name="$IMAGE_NAME-ramdisk" is_public=true container_format=ari disk_format=ari < "$RAMDISK"`
1597
+            RVAL=`glance add -A $TOKEN name="$IMAGE_NAME-ramdisk" is_public=true container_format=ari disk_format=ari < "$RAMDISK"`
1598 1598
             RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
1599 1599
         fi
1600
-        glance add -A $SERVICE_TOKEN name="${IMAGE_NAME%.img}" is_public=true container_format=ami disk_format=ami ${KERNEL_ID:+kernel_id=$KERNEL_ID} ${RAMDISK_ID:+ramdisk_id=$RAMDISK_ID} < <(zcat --force "${IMAGE}")
1600
+        glance add -A $TOKEN name="${IMAGE_NAME%.img}" is_public=true container_format=ami disk_format=ami ${KERNEL_ID:+kernel_id=$KERNEL_ID} ${RAMDISK_ID:+ramdisk_id=$RAMDISK_ID} < <(zcat --force "${IMAGE}")
1601 1601
     done
1602 1602
 fi
1603 1603