Remove api version default values
Now that discovery is plumbed through, get rid of the default api version config values and let discovery work its magic. Leave network_api_version and object_store_api_version in defaults because they only have one version and the extra little config helps not do a few extra senseless api calls. Change-Id: I116e677aa7603710eca7bdaa46e5ea5084023504
This commit is contained in:
@@ -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'
|
||||
|
@@ -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"
|
||||
}
|
||||
|
@@ -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"
|
||||
]
|
||||
}
|
||||
|
@@ -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],
|
||||
|
@@ -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):
|
||||
|
Reference in New Issue
Block a user