summaryrefslogtreecommitdiff
path: root/cinderclient/tests/unit/fixture_data
diff options
context:
space:
mode:
authorDerrick J. Wippler <thrawn01@gmail.com>2015-08-19 15:48:27 -0500
committerDerrick J. Wippler <thrawn01@gmail.com>2015-09-14 08:49:14 -0500
commite8274fa57df3a833f8e46be2e9a6feff366e4b5c (patch)
treed012545375845d9a08d95909c50a2ed4927f26c8 /cinderclient/tests/unit/fixture_data
parent50758ba475e7a8d7783d511b9b161899c41641b5 (diff)
downloadpython-cinderclient-e8274fa57df3a833f8e46be2e9a6feff366e4b5c.tar.gz
No longer ignores CINDER_SERVICE_NAME
Cinderclient now utilizes the CINDER_SERVICE_NAME when deciding what endpoint to choose. Closes-Bug: #1486256 Change-Id: I494a34afe5799e7832b1359b9c24c31ead68b6d1 UpgradeImpact: Existing configurations may select a different endpoint after this patch.
Diffstat (limited to 'cinderclient/tests/unit/fixture_data')
-rw-r--r--cinderclient/tests/unit/fixture_data/keystone_client.py66
1 files changed, 45 insertions, 21 deletions
diff --git a/cinderclient/tests/unit/fixture_data/keystone_client.py b/cinderclient/tests/unit/fixture_data/keystone_client.py
index dc4c6c6..c94977e 100644
--- a/cinderclient/tests/unit/fixture_data/keystone_client.py
+++ b/cinderclient/tests/unit/fixture_data/keystone_client.py
@@ -115,28 +115,49 @@ def generate_v2_project_scoped_token(**kwargs):
}
}}
- # we only care about Neutron and Keystone endpoints
+ # Add endpoint Keystone
o['access']['serviceCatalog'] = [
- {'endpoints': [
- {'publicURL': 'public_' + ref.get('cinder_url'),
- 'internalURL': 'internal_' + ref.get('cinder_url'),
- 'adminURL': 'admin_' + (ref.get('auth_url') or ""),
- 'id': uuid.uuid4().hex,
- 'region': 'RegionOne'
- }],
- 'endpoints_links': [],
- 'name': 'Neutron',
- 'type': 'network'},
- {'endpoints': [
- {'publicURL': ref.get('auth_url'),
- 'adminURL': ref.get('auth_url'),
- 'internalURL': ref.get('auth_url'),
- 'id': uuid.uuid4().hex,
- 'region': 'RegionOne'
- }],
- 'endpoint_links': [],
- 'name': 'keystone',
- 'type': 'identity'}]
+ {
+ 'endpoints': [
+ {
+ 'publicURL': ref.get('auth_url'),
+ 'adminURL': ref.get('auth_url'),
+ 'internalURL': ref.get('auth_url'),
+ 'id': uuid.uuid4().hex,
+ 'region': 'RegionOne'
+ }],
+ 'endpoint_links': [],
+ 'name': 'keystone',
+ 'type': 'identity'
+ }
+ ]
+
+ cinder_endpoint = {
+ 'endpoints': [
+ {
+ 'publicURL': 'public_' + ref.get('cinder_url'),
+ 'internalURL': 'internal_' + ref.get('cinder_url'),
+ 'adminURL': 'admin_' + (ref.get('auth_url') or ""),
+ 'id': uuid.uuid4().hex,
+ 'region': 'RegionOne'
+ }
+ ],
+ 'endpoints_links': [],
+ 'name': None,
+ 'type': 'volumev2'
+ }
+
+ # Add multiple Cinder endpoints
+ for count in range(1, 4):
+ # Copy the endpoint and create a service name
+ endpoint_copy = copy.deepcopy(cinder_endpoint)
+ name = "cinder%i" % count
+ # Assign the service name and a unique endpoint
+ endpoint_copy['endpoints'][0]['publicURL'] = \
+ 'http://%s.api.com/v2' % name
+ endpoint_copy['name'] = name
+
+ o['access']['serviceCatalog'].append(endpoint_copy)
return token, o
@@ -218,6 +239,9 @@ def keystone_request_callback(request, context):
elif request.url == BASE_URL + "/v2.0":
token_id, token_data = generate_v2_project_scoped_token()
return token_data
+ elif request.url.startswith("http://multiple.service.names"):
+ token_id, token_data = generate_v2_project_scoped_token()
+ return json.dumps(token_data)
elif request.url == BASE_URL + "/v3":
token_id, token_data = generate_v3_project_scoped_token()
context.headers["X-Subject-Token"] = token_id