|
...
|
...
|
@@ -2,7 +2,7 @@
|
|
2
|
2
|
|
|
3
|
3
|
# **swift.sh**
|
|
4
|
4
|
|
|
5
|
|
-# Test swift via the ``swift`` command line from ``python-swiftclient``
|
|
|
5
|
+# Test swift via the ``python-openstackclient`` command line
|
|
6
|
6
|
|
|
7
|
7
|
echo "*********************************************************************"
|
|
8
|
8
|
echo "Begin DevStack Exercise: $0"
|
|
...
|
...
|
@@ -39,26 +39,29 @@ is_service_enabled s-proxy || exit 55
|
|
39
|
39
|
|
|
40
|
40
|
# Container name
|
|
41
|
41
|
CONTAINER=ex-swift
|
|
|
42
|
+OBJECT=/etc/issue
|
|
42
|
43
|
|
|
43
|
44
|
|
|
44
|
45
|
# Testing Swift
|
|
45
|
46
|
# =============
|
|
46
|
47
|
|
|
47
|
48
|
# Check if we have to swift via keystone
|
|
48
|
|
-swift stat || die $LINENO "Failure getting status"
|
|
|
49
|
+openstack object store account show || die $LINENO "Failure getting account status"
|
|
49
|
50
|
|
|
50
|
51
|
# We start by creating a test container
|
|
51
|
52
|
openstack container create $CONTAINER || die $LINENO "Failure creating container $CONTAINER"
|
|
52
|
53
|
|
|
53
|
|
-# add some files into it.
|
|
54
|
|
-openstack object create $CONTAINER /etc/issue || die $LINENO "Failure uploading file to container $CONTAINER"
|
|
|
54
|
+# add a file into it.
|
|
|
55
|
+openstack object create $CONTAINER $OBJECT || die $LINENO "Failure uploading file to container $CONTAINER"
|
|
55
|
56
|
|
|
56
|
|
-# list them
|
|
|
57
|
+# list the objects
|
|
57
|
58
|
openstack object list $CONTAINER || die $LINENO "Failure listing contents of container $CONTAINER"
|
|
58
|
59
|
|
|
59
|
|
-# And we may want to delete them now that we have tested that
|
|
60
|
|
-# everything works.
|
|
61
|
|
-swift delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER"
|
|
|
60
|
+# delete the object first
|
|
|
61
|
+openstack object delete $CONTAINER $OBJECT || die $LINENO "Failure deleting object $OBJECT in container $CONTAINER"
|
|
|
62
|
+
|
|
|
63
|
+# delete the container
|
|
|
64
|
+openstack container delete $CONTAINER || die $LINENO "Failure deleting container $CONTAINER"
|
|
62
|
65
|
|
|
63
|
66
|
set +o xtrace
|
|
64
|
67
|
echo "*********************************************************************"
|