Skip discovery for neutron

It's a waste of energy to do discovery. We can always revert if we find
some place where it's a problem.

Change-Id: I8c15a8d775df8a19110dc9ceb6c8e5c8df8fdee0
This commit is contained in:
Monty Taylor 2017-01-21 09:34:22 +01:00
parent a616b64402
commit 3ac4915109
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
3 changed files with 4 additions and 22 deletions

View File

@ -514,7 +514,10 @@ class OpenStackCloud(_normalize.Normalizer):
def _network_client(self):
if 'network' not in self._raw_clients:
client = self._get_raw_client('network')
client.endpoint_override = self._discover_latest_version(client)
# Don't bother with version discovery - there is only one version
# of neutron. This is what neutronclient does, fwiw.
client.endpoint_override = urllib.parse.urljoin(
client.get_endpoint(), 'v2.0')
self._raw_clients['network'] = client
return self._raw_clients['network']

View File

@ -164,13 +164,6 @@ class RequestsMockTestCase(BaseTestCase):
'GET', 'https://image.example.com/',
text=open(discovery_fixture, 'r').read())
def use_neutron(self, network_version_json='network-version.json'):
discovery_fixture = os.path.join(
self.fixtures_directory, network_version_json)
self.register_uri(
'GET', 'https://network.example.com/',
text=open(discovery_fixture, 'r').read())
def register_uri(self, method, uri, **kwargs):
validate = kwargs.pop('validate', {})
key = '{method}:{uri}'.format(method=method, uri=uri)

View File

@ -1,14 +0,0 @@
{
"versions": [
{
"id": "v2.0",
"links": [
{
"href": "http://network.example.com/v2.0",
"rel": "self"
}
],
"status": "CURRENT"
}
]
}