Migrate from using glance image-list to openstackclient

Modify instance of `glance image-list` to `openstack image list`,
in an effort to migrate all commands to unified CLI.

Change-Id: Ieef661d209606e088fbf6a3a394f9a6577667618
This commit is contained in:
Steve Martinelli 2014-08-02 20:32:31 -04:00
parent 5acf159c72
commit 5c206c2b7d
8 changed files with 12 additions and 10 deletions

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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"
}

View File

@ -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

View File

@ -108,6 +108,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

View File

@ -211,7 +211,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."