From bbe59edb6f4a5828362c59a200f6ede00f97a4c3 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Wed, 21 Oct 2015 00:47:43 -0400 Subject: [PATCH] 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 --- exercises/swift.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/exercises/swift.sh b/exercises/swift.sh index afcede81cd..4a41e0f1ed 100755 --- a/exercises/swift.sh +++ b/exercises/swift.sh @@ -2,7 +2,7 @@ # **swift.sh** -# Test swift via the ``swift`` command line from ``python-swiftclient`` +# Test swift via the ``python-openstackclient`` command line echo "*********************************************************************" echo "Begin DevStack Exercise: $0" @@ -39,26 +39,29 @@ is_service_enabled s-proxy || exit 55 # Container name CONTAINER=ex-swift +OBJECT=/etc/issue # Testing Swift # ============= # 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 openstack container create $CONTAINER || die $LINENO "Failure creating container $CONTAINER" -# add some files into it. -openstack object create $CONTAINER /etc/issue || die $LINENO "Failure uploading file to container $CONTAINER" +# add a file into it. +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" -# And we may want to delete them now that we have tested that -# everything works. -swift delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER" +# delete the object first +openstack object delete $CONTAINER $OBJECT || die $LINENO "Failure deleting object $OBJECT in container $CONTAINER" + +# delete the container +openstack container delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER" set +o xtrace echo "*********************************************************************"