summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Cordasco <ian.cordasco@rackspace.com>2015-03-04 15:37:35 -0600
committerIan Cordasco <ian.cordasco@rackspace.com>2015-03-10 19:09:35 -0500
commit5121910a600799ad740179942d14cbf0df7ed349 (patch)
tree0ec9fb6e63342bd6f5bf35cb755eb6ce28580b8a
parent547dc2fcfbd49d1e220b6c2d71d26a6a14b457bd (diff)
downloadglance_store-5121910a600799ad740179942d14cbf0df7ed349.tar.gz
Make dependency on boto entirely conditional
By moving the import into the (only) method that needs boto.exception we retain the ability to list the options from that driver without breaking glance_store.backend.register_opts. Closes-bug: 1426767 Change-Id: Ie35b4b41f71b79502cb2d4b83c2037ec0d798557
-rw-r--r--glance_store/_drivers/s3.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/glance_store/_drivers/s3.py b/glance_store/_drivers/s3.py
index 2fcb550..a0b41ad 100644
--- a/glance_store/_drivers/s3.py
+++ b/glance_store/_drivers/s3.py
@@ -23,7 +23,6 @@ import re
import tempfile
import urlparse
-import boto.exception
import eventlet
from oslo_config import cfg
from oslo_utils import netutils
@@ -103,6 +102,8 @@ def run_upload(part):
Upload the upload part into S3 and set returned etag and size
to its part info.
"""
+ # We defer importing boto until now since it is an optional dependency.
+ import boto.exception
pnum = part.partnum
bsize = part.chunks
LOG.info(_LI("Uploading upload part in S3 partnum=%(pnum)d, "