Merge "Manila: Set multitenancy_enabled in [share]"

This commit is contained in:
Zuul 2021-04-08 21:54:32 +00:00 committed by Gerrit Code Review
commit d4fa5af28d
1 changed files with 8 additions and 0 deletions

View File

@ -52,13 +52,21 @@ class ShareService(VersionedService):
if pools: if pools:
backends = set() backends = set()
enable_protocols = set() enable_protocols = set()
dhss = set()
for pool in pools: for pool in pools:
backends.add(pool['backend']) backends.add(pool['backend'])
protocol = pool['capabilities']['storage_protocol'].lower() protocol = pool['capabilities']['storage_protocol'].lower()
enable_protocols.update(protocol.split('_')) enable_protocols.update(protocol.split('_'))
dhss.add(pool['capabilities']['driver_handles_share_servers'])
conf.set('share', 'backend_names', ','.join(backends)) conf.set('share', 'backend_names', ','.join(backends))
conf.set('share', 'enable_protocols', ','.join(enable_protocols)) conf.set('share', 'enable_protocols', ','.join(enable_protocols))
# NOTE(gouthamr): manila tests can be run with
# driver_handles_share_servers set to either True or False,
# not both at the same time. Lets err on the side of caution and
# set this to True if any DHSS=True backend is present.
conf.set('share', 'multitenancy_enabled', str(any(dhss)))
if len(backends) > 1: if len(backends) > 1:
conf.set('share', 'multi_backend', 'True') conf.set('share', 'multi_backend', 'True')