Merge "Create cinder volume in the correct tenant"

This commit is contained in:
Zuul 2018-01-08 05:34:34 +00:00 committed by Gerrit Code Review
commit 8ad5f0d9fd
2 changed files with 4 additions and 5 deletions

View File

@ -425,12 +425,11 @@ class ContainersController(base.Controller):
for mount in mounts:
if mount['source'] != '':
volume = cinder_api.search_volume(mount['source'])
cinder_api.ensure_volume_usable(volume)
auto_remove = False
else:
volume = cinder_api.create_volume(mount['size'])
auto_remove = True
cinder_api.ensure_volume_usable(volume)
volmapp = objects.VolumeMapping(
context,
volume_id=volume.id, volume_provider='cinder',

View File

@ -69,15 +69,15 @@ class KeystoneClientV3(object):
return session
def _get_auth(self):
if self.context.is_admin:
auth = ka_loading.load_auth_from_conf_options(CONF, CFG_GROUP)
elif self.context.auth_token_info:
if self.context.auth_token_info:
access_info = ka_access.create(body=self.context.auth_token_info,
auth_token=self.context.auth_token)
auth = ka_access_plugin.AccessInfoPlugin(access_info)
elif self.context.auth_token:
auth = ka_v3.Token(auth_url=self.auth_url,
token=self.context.auth_token)
elif self.context.is_admin:
auth = ka_loading.load_auth_from_conf_options(CONF, CFG_GROUP)
else:
msg = ('Keystone API connection failed: no password, '
'trust_id or token found.')