Merge "Adds 'all_tenants' search option in volumeprovider/cinder.py"
This commit is contained in:
commit
88a642e3ff
|
@ -114,7 +114,10 @@ cinder_opts = [
|
|||
cfg.BoolOpt('multiattach',
|
||||
default=False,
|
||||
help=_('Allow the volume to be attached to more than '
|
||||
'one instance.'))
|
||||
'one instance.')),
|
||||
cfg.BoolOpt('all_tenants',
|
||||
default=True,
|
||||
help=_('Allow access over all tenants by provided auth'))
|
||||
]
|
||||
|
||||
nova_group = cfg.OptGroup(
|
||||
|
|
|
@ -128,6 +128,8 @@ class Cinder(provider.Provider):
|
|||
try:
|
||||
search_opts = {'name': docker_volume_name,
|
||||
'metadata': {consts.VOLUME_FROM: CONF.volume_from}}
|
||||
if cinder_conf.all_tenants:
|
||||
search_opts.update({'all_tenants': "true"})
|
||||
vols = self.cinderclient.volumes.list(search_opts=search_opts)
|
||||
except cinder_exception.ClientException as ex:
|
||||
LOG.error("Error happened while getting volume list "
|
||||
|
@ -408,6 +410,8 @@ class Cinder(provider.Provider):
|
|||
docker_volumes = []
|
||||
try:
|
||||
search_opts = {'metadata': {consts.VOLUME_FROM: CONF.volume_from}}
|
||||
if cinder_conf.all_tenants:
|
||||
search_opts.update({'all_tenants': "true"})
|
||||
for vol in self.cinderclient.volumes.list(search_opts=search_opts):
|
||||
docker_volume_name = vol.name
|
||||
if not docker_volume_name:
|
||||
|
|
Loading…
Reference in New Issue