summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2012-03-15 18:01:22 +0000
committerGerrit Code Review <review@openstack.org>2012-03-15 18:01:22 +0000
commit97eb92880e0886a3f257f32a88ba9e55b8ec8a90 (patch)
tree048d7e779277b67cfe044c6b656fa082dd10d77d
parentc303abc2ee08ee5cb34bf90b58ba3daa80d5d256 (diff)
parent1ddee034ac367839495c52fd8adec384693511b9 (diff)
downloadnova-97eb92880e0886a3f257f32a88ba9e55b8ec8a90.tar.gz
nova-97eb92880e0886a3f257f32a88ba9e55b8ec8a90.tar.xz
nova-97eb92880e0886a3f257f32a88ba9e55b8ec8a90.zip
Merge "Add ssl and option to pass tenant to s3 register"
-rw-r--r--nova/image/s3.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/nova/image/s3.py b/nova/image/s3.py
index a0aafe849..570dfea19 100644
--- a/nova/image/s3.py
+++ b/nova/image/s3.py
@@ -51,6 +51,13 @@ s3_opts = [
cfg.StrOpt('s3_secret_key',
default='notchecked',
help='secret key to use for s3 server for images'),
+ cfg.BoolOpt('s3_use_ssl',
+ default=False,
+ help='whether to use ssl when talking to s3'),
+ cfg.BoolOpt('s3_affix_tenant',
+ default=False,
+ help='whether to affix the tenant id to the access key '
+ 'when downloading from s3'),
]
FLAGS = flags.FLAGS
@@ -154,11 +161,13 @@ class S3ImageService(object):
# NOTE(vish): access and secret keys for s3 server are not
# checked in nova-objectstore
access = FLAGS.s3_access_key
+ if FLAGS.s3_affix_tenant:
+ access = '%s:%s' % (access, context.project_id)
secret = FLAGS.s3_secret_key
calling = boto.s3.connection.OrdinaryCallingFormat()
return boto.s3.connection.S3Connection(aws_access_key_id=access,
aws_secret_access_key=secret,
- is_secure=False,
+ is_secure=FLAGS.s3_use_ssl,
calling_format=calling,
port=FLAGS.s3_port,
host=FLAGS.s3_host)