diff --git a/etc/glance-api.conf b/etc/glance-api.conf index 5e6956d52c..254e9db149 100644 --- a/etc/glance-api.conf +++ b/etc/glance-api.conf @@ -94,6 +94,8 @@ swift_enable_snet = False # ============ S3 Store Options ============================= # Address where the S3 authentication service lives +# Valid schemes are 'http://' and 'https://' +# If no scheme specified, default to 'http://' s3_store_host = 127.0.0.1:8080/v1.0/ # User to authenticate against the S3 authentication service diff --git a/glance/store/s3.py b/glance/store/s3.py index 46032055dd..01343be6b9 100644 --- a/glance/store/s3.py +++ b/glance/store/s3.py @@ -38,9 +38,9 @@ class StoreLocation(glance.store.location.StoreLocation): Class describing an S3 URI. An S3 URI can look like any of the following: - s3://accesskey:secretkey@s3service.com/bucket/key-id - s3+http://accesskey:secretkey@s3service.com/bucket/key-id - s3+https://accesskey:secretkey@s3service.com/bucket/key-id + s3://accesskey:secretkey@s3.amazonaws.com/bucket/key-id + s3+http://accesskey:secretkey@s3.amazonaws.com/bucket/key-id + s3+https://accesskey:secretkey@s3.amazonaws.com/bucket/key-id The s3+https:// URIs indicate there is an HTTPS s3service URL """ @@ -84,15 +84,19 @@ class StoreLocation(glance.store.location.StoreLocation): This function works around that issue. """ # Make sure that URIs that contain multiple schemes, such as: - # swift://user:pass@http://authurl.com/v1/container/obj + # s3://accesskey:secretkey@https://s3.amazonaws.com/bucket/key-id # are immediately rejected. if uri.count('://') != 1: - reason = _("URI Cannot contain more than one occurrence of a " - "scheme. If you have specified a " - "URI like s3://user:pass@https://s3.amazonaws.com/" - "bucket/key, you need to change it to use the " - "s3+https:// scheme, like so: " - "s3+https://user:pass@s3.amazonaws.com/bucket/key") + reason = _( + "URI cannot contain more than one occurrence of a scheme." + "If you have specified a URI like " + "s3://accesskey:secretkey@https://s3.amazonaws.com/bucket/" + "key-id" + ", you need to change it to use the s3+https:// scheme, " + "like so: " + "s3+https://accesskey:secretkey@s3.amazonaws.com/bucket/" + "key-id" + ) raise exception.BadStoreUri(uri, reason) pieces = urlparse.urlparse(uri) @@ -203,7 +207,7 @@ class Store(glance.store.base.Store): self.scheme = 's3' if self.s3_host.startswith('https://'): - self.scheme = 'swift+https' + self.scheme = 's3+https' self.full_s3_host = self.s3_host elif self.s3_host.startswith('http://'): self.full_s3_host = self.s3_host