diff options
author | Jenkins <jenkins@review.openstack.org> | 2017-03-04 17:10:50 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2017-03-04 17:10:50 +0000 |
commit | 474db2d18bb28b297eaebea4a2cf54994d3bb2e9 (patch) | |
tree | 6316863fddedacf442ba46c65cbb18238f616984 | |
parent | 40c416cbad77d74d7d8fb964193b309d77ecb628 (diff) | |
parent | 0e039e67c2e3496628141b7b48aff2ff541096c6 (diff) | |
download | os-client-config-474db2d18bb28b297eaebea4a2cf54994d3bb2e9.tar.gz |
Merge "Add support for overriding mistral service type"
-rw-r--r-- | os_client_config/cloud_config.py | 4 | ||||
-rw-r--r-- | os_client_config/defaults.json | 3 | ||||
-rw-r--r-- | os_client_config/tests/test_cloud_config.py | 5 |
3 files changed, 11 insertions, 1 deletions
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) |