diff --git a/os_client_config/cloud_config.py b/os_client_config/cloud_config.py index f52756f..5c4c03e 100644 --- a/os_client_config/cloud_config.py +++ b/os_client_config/cloud_config.py @@ -161,11 +161,15 @@ class CloudConfig(object): # Of course, if the user requests a volumev2, that structure should # still work. # What's even more amazing is that they did it AGAIN with cinder v3 + # And then I learned that mistral copied it. if service_type == 'volume': if self.get_api_version(service_type).startswith('2'): service_type = 'volumev2' elif self.get_api_version(service_type).startswith('3'): service_type = 'volumev3' + elif service_type == 'workflow': + if self.get_api_version(service_type).startswith('2'): + service_type = 'workflowv2' return self.config.get(key, service_type) def get_service_name(self, service_type): diff --git a/os_client_config/defaults.json b/os_client_config/defaults.json index 65f8961..2a195c4 100644 --- a/os_client_config/defaults.json +++ b/os_client_config/defaults.json @@ -22,5 +22,6 @@ "orchestration_api_version": "1", "secgroup_source": "neutron", "status": "active", - "volume_api_version": "2" + "volume_api_version": "2", + "workflow_api_version": "2" } diff --git a/os_client_config/tests/test_cloud_config.py b/os_client_config/tests/test_cloud_config.py index 6f960e6..ce724cb 100644 --- a/os_client_config/tests/test_cloud_config.py +++ b/os_client_config/tests/test_cloud_config.py @@ -163,6 +163,11 @@ class TestCloudConfig(base.TestCase): cc.config['volume_api_version'] = '3' self.assertEqual('volumev3', cc.get_service_type('volume')) + def test_workflow_override_v2(self): + cc = cloud_config.CloudConfig("test1", "region-al", fake_services_dict) + cc.config['workflow_api_version'] = '2' + self.assertEqual('workflowv2', cc.get_service_type('workflow')) + def test_get_session_no_auth(self): config_dict = defaults.get_defaults() config_dict.update(fake_services_dict)