Browse code

Merge "Migrate from using glance image-list to openstackclient"

Jenkins authored on 2014/08/25 23:05:53
Showing 8 changed files
... ...
@@ -71,10 +71,10 @@ nova list
71 71
 # ------
72 72
 
73 73
 # List the images available
74
-glance image-list
74
+openstack image list
75 75
 
76 76
 # Grab the id of the image to launch
77
-IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
77
+IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
78 78
 die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
79 79
 
80 80
 # Security Groups
... ...
@@ -122,7 +122,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
122 122
         STATUS_GLANCE="Skipped"
123 123
     else
124 124
         echo -e "\nTest Glance"
125
-        if glance $TENANT_ARG $ARGS image-list; then
125
+        if openstack $TENANT_ARG $ARGS image list; then
126 126
             STATUS_GLANCE="Succeeded"
127 127
         else
128 128
             STATUS_GLANCE="Failed"
... ...
@@ -132,7 +132,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
132 132
         STATUS_GLANCE="Skipped"
133 133
     else
134 134
         echo -e "\nTest Glance"
135
-        if glance image-list; then
135
+        if openstack image list; then
136 136
             STATUS_GLANCE="Succeeded"
137 137
         else
138 138
             STATUS_GLANCE="Failed"
... ...
@@ -71,10 +71,10 @@ nova list
71 71
 # ------
72 72
 
73 73
 # List the images available
74
-glance image-list
74
+openstack image list
75 75
 
76 76
 # Grab the id of the image to launch
77
-IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
77
+IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
78 78
 die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
79 79
 
80 80
 # Security Groups
... ...
@@ -134,7 +134,7 @@ function foreach_tenant_net {
134 134
 }
135 135
 
136 136
 function get_image_id {
137
-    local IMAGE_ID=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
137
+    local IMAGE_ID=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
138 138
     die_if_not_set $LINENO IMAGE_ID "Failure retrieving IMAGE_ID"
139 139
     echo "$IMAGE_ID"
140 140
 }
... ...
@@ -68,10 +68,10 @@ nova list
68 68
 # ------
69 69
 
70 70
 # List the images available
71
-glance image-list
71
+openstack image list
72 72
 
73 73
 # Grab the id of the image to launch
74
-IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
74
+IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
75 75
 die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
76 76
 
77 77
 # Security Groups
... ...
@@ -112,6 +112,8 @@ function configure_tempest {
112 112
             image_uuid_alt="$IMAGE_UUID"
113 113
         fi
114 114
         images+=($IMAGE_UUID)
115
+    # TODO(stevemar): update this command to use openstackclient's `openstack image list`
116
+    # when it supports listing by status.
115 117
     done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
116 118
 
117 119
     case "${#images[*]}" in
... ...
@@ -210,7 +210,7 @@ function init_trove {
210 210
     # The image is uploaded by stack.sh -- see $IMAGE_URLS handling
211 211
     GUEST_IMAGE_NAME=$(basename "$TROVE_GUEST_IMAGE_URL")
212 212
     GUEST_IMAGE_NAME=${GUEST_IMAGE_NAME%.*}
213
-    TROVE_GUEST_IMAGE_ID=$(glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-list | grep "${GUEST_IMAGE_NAME}" | get_field 1)
213
+    TROVE_GUEST_IMAGE_ID=$(openstack --os-token $TOKEN --os-url http://$GLANCE_HOSTPORT image list | grep "${GUEST_IMAGE_NAME}" | get_field 1)
214 214
     if [ -z "$TROVE_GUEST_IMAGE_ID" ]; then
215 215
         # If no glance id is found, skip remaining setup
216 216
         echo "Datastore ${TROVE_DATASTORE_TYPE} will not be created: guest image ${GUEST_IMAGE_NAME} not found."