Use openstackclient in swift exercises
With the release of osc 1.8.0, swift support has been expanded and we can now remove references to the swift CLI from this exercise file. Also made minor improvements to comments. Change-Id: I04069eb6251f8cbf8266183441b2cfdb64defd7d
This commit is contained in:
parent
d9da93ede2
commit
bbe59edb6f
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
# **swift.sh**
|
# **swift.sh**
|
||||||
|
|
||||||
# Test swift via the ``swift`` command line from ``python-swiftclient``
|
# Test swift via the ``python-openstackclient`` command line
|
||||||
|
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
echo "Begin DevStack Exercise: $0"
|
echo "Begin DevStack Exercise: $0"
|
||||||
@ -39,26 +39,29 @@ is_service_enabled s-proxy || exit 55
|
|||||||
|
|
||||||
# Container name
|
# Container name
|
||||||
CONTAINER=ex-swift
|
CONTAINER=ex-swift
|
||||||
|
OBJECT=/etc/issue
|
||||||
|
|
||||||
|
|
||||||
# Testing Swift
|
# Testing Swift
|
||||||
# =============
|
# =============
|
||||||
|
|
||||||
# Check if we have to swift via keystone
|
# Check if we have to swift via keystone
|
||||||
swift stat || die $LINENO "Failure getting status"
|
openstack object store account show || die $LINENO "Failure getting account status"
|
||||||
|
|
||||||
# We start by creating a test container
|
# We start by creating a test container
|
||||||
openstack container create $CONTAINER || die $LINENO "Failure creating container $CONTAINER"
|
openstack container create $CONTAINER || die $LINENO "Failure creating container $CONTAINER"
|
||||||
|
|
||||||
# add some files into it.
|
# add a file into it.
|
||||||
openstack object create $CONTAINER /etc/issue || die $LINENO "Failure uploading file to container $CONTAINER"
|
openstack object create $CONTAINER $OBJECT || die $LINENO "Failure uploading file to container $CONTAINER"
|
||||||
|
|
||||||
# list them
|
# list the objects
|
||||||
openstack object list $CONTAINER || die $LINENO "Failure listing contents of container $CONTAINER"
|
openstack object list $CONTAINER || die $LINENO "Failure listing contents of container $CONTAINER"
|
||||||
|
|
||||||
# And we may want to delete them now that we have tested that
|
# delete the object first
|
||||||
# everything works.
|
openstack object delete $CONTAINER $OBJECT || die $LINENO "Failure deleting object $OBJECT in container $CONTAINER"
|
||||||
swift delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER"
|
|
||||||
|
# delete the container
|
||||||
|
openstack container delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER"
|
||||||
|
|
||||||
set +o xtrace
|
set +o xtrace
|
||||||
echo "*********************************************************************"
|
echo "*********************************************************************"
|
||||||
|
Loading…
Reference in New Issue
Block a user