Merge "Fixing Senlin incompatibility with openstacksdk 0.11.x"

This commit is contained in:
Zuul 2018-04-18 18:54:19 +00:00 committed by Gerrit Code Review
commit 052ca49c87
2 changed files with 10 additions and 1 deletions

View File

@ -42,9 +42,13 @@ class OpenStackSDKPlugin(client_plugin.ClientPlugin):
config=self._get_service_interfaces(),
region_name=self._get_region_name(),
app_name='heat',
app_version=heat.version.version_info.version_string())
app_version=heat.version.version_info.version_string(),
**self._get_additional_create_args(version))
return connection.Connection(config=config)
def _get_additional_create_args(self, version):
return {}
def _get_service_interfaces(self):
interfaces = {}
if not os_service_types:

View File

@ -29,6 +29,11 @@ class SenlinClientPlugin(sdk_plugin.OpenStackSDKPlugin):
client = super(SenlinClientPlugin, self)._create(version=version)
return client.clustering
def _get_additional_create_args(self, version):
return {
'clustering_api_version': version or '1'
}
def generate_spec(self, spec_type, spec_props):
spec = {'properties': spec_props}
spec['type'], spec['version'] = spec_type.split('-')