Merge "Add swift_store_admin_tenants option."

This commit is contained in:
Jenkins 2012-08-02 18:38:57 +00:00 committed by Gerrit Code Review
commit bab5aa1d6a
3 changed files with 18 additions and 0 deletions

View File

@ -392,6 +392,17 @@ If set to True enables multi-tenant storage mode which causes Glance images
to be stored in tenant specific Swift accounts. When set to False Glance
stores all images in a single Swift account.
* ``swift_store_admin_tenants``
Can only be specified in configuration files.
`This option is specific to the Swift storage backend.`
Optional. Default: ``[]``
A list of tenants that will be granted read/write access on all Swift containers
created by Glance in multi tenant mode.
Configuring the S3 Storage Backend
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -207,6 +207,10 @@ swift_enable_snet = False
# to be stored in tenant specific Swift accounts.
# swift_store_multi_tenant = False
# A list of tenants that will be granted read/write access on all Swift
# containers created by Glance in multi-tenant mode.
# swift_store_admin_tenants = []
# ============ S3 Store Options =============================
# Address where the S3 authentication service lives

View File

@ -59,6 +59,7 @@ swift_opts = [
default=DEFAULT_LARGE_OBJECT_CHUNK_SIZE),
cfg.BoolOpt('swift_store_create_container_on_put', default=False),
cfg.BoolOpt('swift_store_multi_tenant', default=False),
cfg.BoolOpt('swift_store_admin_tenants', default=[]),
]
CONF = cfg.CONF
@ -214,6 +215,7 @@ class Store(glance.store.base.Store):
def configure(self):
self.snet = CONF.swift_enable_snet
self.multi_tenant = CONF.swift_store_multi_tenant
self.admin_tenants = CONF.swift_store_admin_tenants
self.auth_version = self._option_get('swift_store_auth_version')
self.storage_url = None
self.token = None
@ -618,6 +620,7 @@ class Store(glance.store.base.Store):
else:
headers['X-Container-Read'] = ''
write_tenants.extend(self.admin_tenants)
if write_tenants:
headers['X-Container-Write'] = ','.join(write_tenants)
else: