Merge "Drop unused method"
This commit is contained in:
@@ -95,16 +95,6 @@ def _endpoint_from_image_ref(image_href):
|
||||
return (image_id, endpoint)
|
||||
|
||||
|
||||
def generate_identity_headers(context, status='Confirmed'):
|
||||
return {
|
||||
'X-Auth-Token': getattr(context, 'auth_token', None),
|
||||
'X-User-Id': getattr(context, 'user_id', None),
|
||||
'X-Tenant-Id': getattr(context, 'project_id', None),
|
||||
'X-Roles': ','.join(getattr(context, 'roles', [])),
|
||||
'X-Identity-Status': status,
|
||||
}
|
||||
|
||||
|
||||
def get_api_servers(context):
|
||||
"""Shuffle a list of service endpoints and return an iterator that will
|
||||
cycle through the list, looping around to the beginning if necessary.
|
||||
|
||||
@@ -391,21 +391,6 @@ class TestCreateGlanceClient(test.NoDBTestCase):
|
||||
self.assertEqual("a", result1)
|
||||
self.assertEqual("b", result2)
|
||||
|
||||
def test_generate_identity_headers(self):
|
||||
ctx = context.RequestContext('user', 'tenant',
|
||||
auth_token='token', roles=["a", "b"])
|
||||
|
||||
result = glance.generate_identity_headers(ctx, 'test')
|
||||
|
||||
expected = {
|
||||
'X-Auth-Token': 'token',
|
||||
'X-User-Id': 'user',
|
||||
'X-Tenant-Id': 'tenant',
|
||||
'X-Roles': 'a,b',
|
||||
'X-Identity-Status': 'test',
|
||||
}
|
||||
self.assertDictEqual(expected, result)
|
||||
|
||||
|
||||
class TestGlanceClientWrapperRetries(test.NoDBTestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user