Browse code

attempt to get the id from glance redux

Jesse Andrews authored on 2011/10/03 10:07:08
Showing 1 changed files
... ...
@@ -576,10 +576,10 @@ if [[ "$ENABLED_SERVICES" =~ "g-reg" ]]; then
576 576
     tar -zxf $FILES/tty.tgz -C $FILES/images
577 577
 
578 578
     # add a debugging images to glance
579
-    KERNEL_ID=`glance add -A $SERVICE_TOKEN name="tty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/aki-tty/image`
580
-    KERNEL_ID=1 # FIXME: parse glance results
581
-    RAMDISK_ID=`glance add -A $SERVICE_TOKEN name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < $FILES/images/ari-tty/image`
582
-    RAMDISK_ID=2 # FIXME: parse glance results
579
+    RVAL=`glance add -A $SERVICE_TOKEN name="tty-kernel" is_public=true container_format=aki disk_format=aki < $FILES/images/aki-tty/image`
580
+    KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
581
+    RVAL=`glance add -A $SERVICE_TOKEN name="tty-ramdisk" is_public=true container_format=ari disk_format=ari < $FILES/images/ari-tty/image`
582
+    RAMDISK_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`
583 583
     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
584 584
 fi
585 585