diff --git a/glance/store/s3.py b/glance/store/s3.py index 9ba34d5e52..f23bcb1bf6 100644 --- a/glance/store/s3.py +++ b/glance/store/s3.py @@ -15,7 +15,7 @@ # License for the specific language governing permissions and limitations # under the License. -""" the s3 backend adapter """ +"""the s3 backend adapter""" from __future__ import absolute_import import glance.store @@ -23,7 +23,7 @@ class S3Backend(glance.store.Backend): - """ An implementation of the s3 adapter. """ + """An implementation of the s3 adapter.""" EXAMPLE_URL = "s3://ACCESS_KEY:SECRET_KEY@s3_url/bucket/file.gz.0" @@ -86,7 +86,7 @@ def delete(cls, parsed_uri, conn_class=None): @classmethod def _get_bucket(cls, conn, bucket_id): - """ Get a bucket from an s3 connection """ + """Get a bucket from an s3 connection""" bucket = conn.get_bucket(bucket_id) if not bucket: @@ -97,7 +97,7 @@ def _get_bucket(cls, conn, bucket_id): @classmethod def _get_key(cls, bucket, obj): - """ Get a key from a bucket """ + """Get a key from a bucket""" key = bucket.get_key(obj) if not key: @@ -106,5 +106,5 @@ def _get_key(cls, bucket, obj): @classmethod def _parse_s3_tokens(cls, parsed_uri): - """ Parse tokens from the parsed_uri """ + """Parse tokens from the parsed_uri""" return glance.store.parse_uri_tokens(parsed_uri, cls.EXAMPLE_URL) diff --git a/glance/store/swift.py b/glance/store/swift.py index f7c342cc15..68655e78bc 100644 --- a/glance/store/swift.py +++ b/glance/store/swift.py @@ -17,7 +17,6 @@ from __future__ import absolute_import import glance.store -import swift.common.client class SwiftBackend(glance.store.Backend): @@ -117,5 +116,6 @@ def _parse_swift_tokens(cls, parsed_uri): def get_connection_class(conn_class): if not conn_class: + import swift.common.client conn_class = swift.common.client.Connection return conn_class