Make name setting in connect_as more resilient

This setting of the name is currently a hack and is mucking about
behing the OCC scenes. We need to be able to step out of it, but to
do that we need to muck about behind the SDK scenes for a second too.

Change-Id: I772a3d99c354f32c6341d8f409a8e839461af736
This commit is contained in:
Monty Taylor 2018-04-27 13:35:35 -05:00
parent 6b312cfffe
commit b95b0c7f60
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 4 additions and 1 deletions

View File

@ -369,7 +369,10 @@ class OpenStackCloud(
session_constructor=session_constructor,
**params)
# Override the cloud name so that logging/location work right
cloud_config.name = self.name
if hasattr(cloud_config, '_name'):
cloud_config._name = self.name
else:
cloud_config.name = self.name
cloud_config.config['profile'] = self.name
# Use self.__class__ so that OperatorCloud will return an OperatorCloud
# instance. This should also help passthrough from sdk work better when