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:
parent
5acf159c72
commit
5c206c2b7d
@ -71,10 +71,10 @@ nova list
|
|||||||
# ------
|
# ------
|
||||||
|
|
||||||
# List the images available
|
# List the images available
|
||||||
glance image-list
|
openstack image list
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# 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"
|
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||||
|
|
||||||
# Security Groups
|
# Security Groups
|
||||||
|
@ -122,7 +122,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
|||||||
STATUS_GLANCE="Skipped"
|
STATUS_GLANCE="Skipped"
|
||||||
else
|
else
|
||||||
echo -e "\nTest Glance"
|
echo -e "\nTest Glance"
|
||||||
if glance $TENANT_ARG $ARGS image-list; then
|
if openstack $TENANT_ARG $ARGS image list; then
|
||||||
STATUS_GLANCE="Succeeded"
|
STATUS_GLANCE="Succeeded"
|
||||||
else
|
else
|
||||||
STATUS_GLANCE="Failed"
|
STATUS_GLANCE="Failed"
|
||||||
|
@ -132,7 +132,7 @@ if [[ "$ENABLED_SERVICES" =~ "g-api" ]]; then
|
|||||||
STATUS_GLANCE="Skipped"
|
STATUS_GLANCE="Skipped"
|
||||||
else
|
else
|
||||||
echo -e "\nTest Glance"
|
echo -e "\nTest Glance"
|
||||||
if glance image-list; then
|
if openstack image list; then
|
||||||
STATUS_GLANCE="Succeeded"
|
STATUS_GLANCE="Succeeded"
|
||||||
else
|
else
|
||||||
STATUS_GLANCE="Failed"
|
STATUS_GLANCE="Failed"
|
||||||
|
@ -71,10 +71,10 @@ nova list
|
|||||||
# ------
|
# ------
|
||||||
|
|
||||||
# List the images available
|
# List the images available
|
||||||
glance image-list
|
openstack image list
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# 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"
|
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||||
|
|
||||||
# Security Groups
|
# Security Groups
|
||||||
|
@ -134,7 +134,7 @@ function foreach_tenant_net {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function get_image_id {
|
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"
|
die_if_not_set $LINENO IMAGE_ID "Failure retrieving IMAGE_ID"
|
||||||
echo "$IMAGE_ID"
|
echo "$IMAGE_ID"
|
||||||
}
|
}
|
||||||
|
@ -68,10 +68,10 @@ nova list
|
|||||||
# ------
|
# ------
|
||||||
|
|
||||||
# List the images available
|
# List the images available
|
||||||
glance image-list
|
openstack image list
|
||||||
|
|
||||||
# Grab the id of the image to launch
|
# 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"
|
die_if_not_set $LINENO IMAGE "Failure getting image $DEFAULT_IMAGE_NAME"
|
||||||
|
|
||||||
# Security Groups
|
# Security Groups
|
||||||
|
@ -108,6 +108,8 @@ function configure_tempest {
|
|||||||
image_uuid_alt="$IMAGE_UUID"
|
image_uuid_alt="$IMAGE_UUID"
|
||||||
fi
|
fi
|
||||||
images+=($IMAGE_UUID)
|
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 }')
|
done < <(glance image-list --status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
||||||
|
|
||||||
case "${#images[*]}" in
|
case "${#images[*]}" in
|
||||||
|
@ -211,7 +211,7 @@ function init_trove {
|
|||||||
# The image is uploaded by stack.sh -- see $IMAGE_URLS handling
|
# The image is uploaded by stack.sh -- see $IMAGE_URLS handling
|
||||||
GUEST_IMAGE_NAME=$(basename "$TROVE_GUEST_IMAGE_URL")
|
GUEST_IMAGE_NAME=$(basename "$TROVE_GUEST_IMAGE_URL")
|
||||||
GUEST_IMAGE_NAME=${GUEST_IMAGE_NAME%.*}
|
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 [ -z "$TROVE_GUEST_IMAGE_ID" ]; then
|
||||||
# If no glance id is found, skip remaining setup
|
# 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."
|
echo "Datastore ${TROVE_DATASTORE_TYPE} will not be created: guest image ${GUEST_IMAGE_NAME} not found."
|
||||||
|
Loading…
Reference in New Issue
Block a user