Merge "Migrate from using glance image-list to openstackclient"
This commit is contained in:
commit
38417fc9e0
@ -71,10 +71,10 @@ nova list
|
||||
# ------
|
||||
|
||||
# List the images available
|
||||
glance image-list
|
||||
openstack image list
|
||||
|
||||
# Grab the id of the image to launch
|
||||
IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||
|
||||
# Security Groups
|
||||
|
@ -122,7 +122,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
||||
STATUS_GLANCE="Skipped"
|
||||
else
|
||||
echo -e "\nTest Glance"
|
||||
if glance $TENANT_ARG $ARGS image-list; then
|
||||
if openstack $TENANT_ARG $ARGS image list; then
|
||||
STATUS_GLANCE="Succeeded"
|
||||
else
|
||||
STATUS_GLANCE="Failed"
|
||||
|
@ -132,7 +132,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
||||
STATUS_GLANCE="Skipped"
|
||||
else
|
||||
echo -e "\nTest Glance"
|
||||
if glance image-list; then
|
||||
if openstack image list; then
|
||||
STATUS_GLANCE="Succeeded"
|
||||
else
|
||||
STATUS_GLANCE="Failed"
|
||||
|
@ -71,10 +71,10 @@ nova list
|
||||
# ------
|
||||
|
||||
# List the images available
|
||||
glance image-list
|
||||
openstack image list
|
||||
|
||||
# Grab the id of the image to launch
|
||||
IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||
|
||||
# Security Groups
|
||||
|
@ -134,7 +134,7 @@ function foreach_tenant_net {
|
||||
}
|
||||
|
||||
function get_image_id {
|
||||
local IMAGE_ID=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
local IMAGE_ID=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
die_if_not_set $LINENO IMAGE_ID "Failure retrieving IMAGE_ID"
|
||||
echo "$IMAGE_ID"
|
||||
}
|
||||
|
@ -68,10 +68,10 @@ nova list
|
||||
# ------
|
||||
|
||||
# List the images available
|
||||
glance image-list
|
||||
openstack image list
|
||||
|
||||
# Grab the id of the image to launch
|
||||
IMAGE=$(glance image-list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
IMAGE=$(openstack image list | egrep " $DEFAULT_IMAGE_NAME " | get_field 1)
|
||||
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||
|
||||
# Security Groups
|
||||
|
@ -112,6 +112,8 @@ function configure_tempest {
|
||||
image_uuid_alt="$IMAGE_UUID"
|
||||
fi
|
||||
images+=($IMAGE_UUID)
|
||||
# TODO(stevemar): update this command to use openstackclient's `openstack image list`
|
||||
# when it supports listing by status.
|
||||
done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
||||
|
||||
case "${#images[*]}" in
|
||||
|
@ -210,7 +210,7 @@ function init_trove {
|
||||
# The image is uploaded by stack.sh -- see $IMAGE_URLS handling
|
||||
GUEST_IMAGE_NAME=$(basename "$TROVE_GUEST_IMAGE_URL")
|
||||
GUEST_IMAGE_NAME=${GUEST_IMAGE_NAME%.*}
|
||||
TROVE_GUEST_IMAGE_ID=$(glance --os-auth-token $TOKEN --os-image-url http://$GLANCE_HOSTPORT image-list | grep "${GUEST_IMAGE_NAME}" | get_field 1)
|
||||
TROVE_GUEST_IMAGE_ID=$(openstack --os-token $TOKEN --os-url http://$GLANCE_HOSTPORT image list | grep "${GUEST_IMAGE_NAME}" | get_field 1)
|
||||
if [ -z "$TROVE_GUEST_IMAGE_ID" ]; then
|
||||
# If no glance id is found, skip remaining setup
|
||||
echo "Datastore ${TROVE_DATASTORE_TYPE} will not be created: guest image ${GUEST_IMAGE_NAME} not found."
|
||||
|
Loading…
Reference in New Issue
Block a user