From 6a19bf9778ee01a4aa266e029ab3d8fad169cd43 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 1 Sep 2024 21:46:20 +0900 Subject: [PATCH] Drop unused method The generate_identity_headers method is not used. Change-Id: Ie08232e89dad5d7c6c2ee36298b321f1e7eb29ca Signed-off-by: Takashi Kajinami --- nova/image/glance.py | 10 ---------- nova/tests/unit/image/test_glance.py | 15 --------------- 2 files changed, 25 deletions(-) diff --git a/nova/image/glance.py b/nova/image/glance.py index 92417feafa..3af555978d 100644 --- a/nova/image/glance.py +++ b/nova/image/glance.py @@ -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. diff --git a/nova/tests/unit/image/test_glance.py b/nova/tests/unit/image/test_glance.py index 18d06ab950..769d797a05 100644 --- a/nova/tests/unit/image/test_glance.py +++ b/nova/tests/unit/image/test_glance.py @@ -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):