diff --git a/openstack/cloud/openstackcloud.py b/openstack/cloud/openstackcloud.py index 37f6494e5..831f79a46 100755 --- a/openstack/cloud/openstackcloud.py +++ b/openstack/cloud/openstackcloud.py @@ -481,7 +481,7 @@ class OpenStackCloud(_normalize.Normalizer): # If we detect a different version that was configured, warn the user. # shade still knows what to do - but if the user gave us an explicit # version and we couldn't find it, they may want to investigate. - if api_version and (api_major != config_major): + if api_version and config_version and (api_major != config_major): warning_msg = ( '{service_type} is configured for {config_version}' ' but only {api_version} is available. shade is happy' diff --git a/openstack/config/defaults.json b/openstack/config/defaults.json index 17d69e264..508932271 100644 --- a/openstack/config/defaults.json +++ b/openstack/config/defaults.json @@ -1,30 +1,14 @@ { - "application_catalog_api_version": "1", "auth_type": "password", - "baremetal_api_version": "1", "baremetal_status_code_retries": 5, - "block_storage_api_version": "2", - "clustering_api_version": "1", - "container_api_version": "1", - "container_infra_api_version": "1", - "compute_api_version": "2", - "database_api_version": "1.0", "disable_vendor_agent": {}, - "dns_api_version": "2", "interface": "public", "floating_ip_source": "neutron", - "identity_api_version": "2.0", "image_api_use_tasks": false, - "image_api_version": "2", "image_format": "qcow2", - "key_manager_api_version": "v1", "message": "", - "metering_api_version": "2", "network_api_version": "2", "object_store_api_version": "1", - "orchestration_api_version": "1", "secgroup_source": "neutron", - "status": "active", - "volume_api_version": "2", - "workflow_api_version": "2" + "status": "active" } diff --git a/openstack/config/schema.json b/openstack/config/schema.json index 1e5b6c66b..cd430d061 100644 --- a/openstack/config/schema.json +++ b/openstack/config/schema.json @@ -108,20 +108,11 @@ }, "required": [ "auth_type", - "baremetal_api_version", - "block_storage_api_version", - "compute_api_version", - "database_api_version", "disable_vendor_agent", - "dns_api_version", "floating_ip_source", - "identity_api_version", "image_api_use_tasks", - "image_api_version", "image_format", "interface", - "network_api_version", - "object_store_api_version", "secgroup_source" ] } diff --git a/openstack/tests/unit/config/test_config.py b/openstack/tests/unit/config/test_config.py index b92071126..bb134ddfe 100644 --- a/openstack/tests/unit/config/test_config.py +++ b/openstack/tests/unit/config/test_config.py @@ -104,22 +104,6 @@ class TestConfig(base.TestCase): defaults._defaults['auth_type'], cc.auth_type, ) - self.assertEqual( - defaults._defaults['identity_api_version'], - cc.identity_api_version, - ) - - def test_get_one_auth_override_defaults(self): - default_options = {'compute_api_version': '4'} - c = config.OpenStackConfig(config_files=[self.cloud_yaml], - override_defaults=default_options) - cc = c.get_one(cloud='_test-cloud_', auth={'username': 'user'}) - self.assertEqual('user', cc.auth['username']) - self.assertEqual('4', cc.compute_api_version) - self.assertEqual( - defaults._defaults['identity_api_version'], - cc.identity_api_version, - ) def test_get_one_with_config_files(self): c = config.OpenStackConfig(config_files=[self.cloud_yaml], diff --git a/openstack/tests/unit/test_connection.py b/openstack/tests/unit/test_connection.py index cb5860f46..a14e5af2d 100644 --- a/openstack/tests/unit/test_connection.py +++ b/openstack/tests/unit/test_connection.py @@ -113,14 +113,14 @@ class TestConnection(base.TestCase): def test_create_connection_version_param_default(self): c1 = connection.Connection(cloud='sample') conn = connection.Connection(session=c1.session) - self.assertEqual('openstack.identity.v2._proxy', + self.assertEqual('openstack.identity.v3._proxy', conn.identity.__class__.__module__) def test_create_connection_version_param_string(self): c1 = connection.Connection(cloud='sample') conn = connection.Connection( - session=c1.session, identity_api_version='3') - self.assertEqual('openstack.identity.v3._proxy', + session=c1.session, identity_api_version='2') + self.assertEqual('openstack.identity.v2._proxy', conn.identity.__class__.__module__) def test_create_connection_version_param_int(self):