)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"a8df057ba26a8b8802e369225164b23ce431db2e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"84735a22_989c66fd","updated":"2026-01-21 13:27:04.000000000","message":"Needs pep8 cleanup","commit_id":"6a297f9631a0f07815dac14ca3f401043ef81c42"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ce0e974f6091484fab6ad3600b8634577d5c581e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"f9eab3d0_5ece4421","updated":"2026-01-27 19:08:50.000000000","message":"Thanks for the fix Ade!\n-1 is for the releasenote since it\u0027s adding two new config options for the [DEFAULT] and [glance] groups respectively and also fixing a bug.\nI also have one question inline regarding the logic.","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0c9533e8e78d49daf1f3f12ddede8a396cc0f2ad","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9bc46eed_ebda8d0e","updated":"2026-01-23 20:49:18.000000000","message":"recheck","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"60f6795b580312b70b4e4ede2b8901fde7f4ddaf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"6ded3e47_acbb5296","updated":"2026-01-30 04:22:13.000000000","message":"I haven\u0027t tested the changes due to unavailability of a multi region deployment but the changes looks good to me and should work given we are handling cases where endpoint is not available or not configured.","commit_id":"f96be085f8961f92fe264cad225d7847ffe05290"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"b57656311584a434181938cd828b1364818afffd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"a014ba66_f848b315","updated":"2026-01-30 04:28:47.000000000","message":"One more thing i wanted to mention is that the [glance] section was added in 2025.2 release so if we plan to backport it further back:\n1. we can either add a region_name config option in the DEFAULT section\n2. backport the change[1] along with this but since both of these are features, I\u0027m not sure what the implications could be.\n\n[1] https://review.opendev.org/c/openstack/cinder/+/958716","commit_id":"f96be085f8961f92fe264cad225d7847ffe05290"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"cf645ad8034c23f822ab8ab2538308d31d43796a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"62a44320_9842f008","in_reply_to":"7a579310_1d7ec31f","updated":"2026-01-30 17:31:07.000000000","message":"yup - we\u0027ll look at this in the relevant backport patches.","commit_id":"f96be085f8961f92fe264cad225d7847ffe05290"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9e230e80bc23cd3a2af1637fd108b88fee5fbd67","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"7a579310_1d7ec31f","in_reply_to":"a014ba66_f848b315","updated":"2026-01-30 05:26:16.000000000","message":"On second thought, we might be using the service_user section for glance\u003c-\u003ecinder interaction before the introduction of [glance] section. could you please verify and add the support accordingly?","commit_id":"f96be085f8961f92fe264cad225d7847ffe05290"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"c47570ceded8f597846df975fb486634aa34067a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"17e6cad7_3c58503a","updated":"2026-01-30 19:59:23.000000000","message":"fixed the nit and consolidated the repeated code in utils.","commit_id":"8a53ae9910db97fa0af51341cd037bc1388b39d7"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"0e10416ccc876e1cc1080b822b26ab5280b04c87","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"1e6ab284_59c6c26a","updated":"2026-02-02 07:04:09.000000000","message":"one last change request otherwise looks good","commit_id":"8a53ae9910db97fa0af51341cd037bc1388b39d7"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"541f0af3b6f143148ce01283515eb69652215f54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"ca68b5ad_89de7166","updated":"2026-02-03 14:15:07.000000000","message":"LGTM, thanks Ade for bearing me through the review process. 😄","commit_id":"e804a15ec3adda5b81dcba0160696c5f8229ca97"}],"cinder/backup/drivers/swift.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"421ba2604ec3a1fec9739ef4423f4d373d2b64c1","unresolved":true,"context_lines":[{"line_number":147,"context_line":"                help\u003d\u0027Send a X-Service-Token header with service auth \u0027"},{"line_number":148,"context_line":"                     \u0027credentials. If enabled you also must set the \u0027"},{"line_number":149,"context_line":"                     \u0027service_user group and enable send_service_user_token.\u0027),"},{"line_number":150,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":151,"context_line":"               help\u003d\u0027Name of swift region to use. Useful if keystone manages \u0027"},{"line_number":152,"context_line":"                    \u0027more than one region.\u0027),"},{"line_number":153,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":2,"id":"01f8ed64_7365a69c","line":150,"range":{"start_line":150,"start_character":16,"end_line":150,"end_character":27},"updated":"2026-01-22 14:44:42.000000000","message":"Nit\nto be consistent shouldn\u0027t this be backup_swift_region_name?","commit_id":"6a297f9631a0f07815dac14ca3f401043ef81c42"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0c9533e8e78d49daf1f3f12ddede8a396cc0f2ad","unresolved":false,"context_lines":[{"line_number":147,"context_line":"                help\u003d\u0027Send a X-Service-Token header with service auth \u0027"},{"line_number":148,"context_line":"                     \u0027credentials. If enabled you also must set the \u0027"},{"line_number":149,"context_line":"                     \u0027service_user group and enable send_service_user_token.\u0027),"},{"line_number":150,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":151,"context_line":"               help\u003d\u0027Name of swift region to use. Useful if keystone manages \u0027"},{"line_number":152,"context_line":"                    \u0027more than one region.\u0027),"},{"line_number":153,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":2,"id":"acaed559_e496de54","line":150,"range":{"start_line":150,"start_character":16,"end_line":150,"end_character":27},"in_reply_to":"01f8ed64_7365a69c","updated":"2026-01-23 20:49:18.000000000","message":"Done","commit_id":"6a297f9631a0f07815dac14ca3f401043ef81c42"},{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"8839f95d987166b5d739fd17768926373425bcd0","unresolved":true,"context_lines":[{"line_number":226,"context_line":"                        # the service catalog, so once the correct one is found"},{"line_number":227,"context_line":"                        # it is safe to break out of the loop"},{"line_number":228,"context_line":"                        for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":229,"context_line":"                            if (not CONF.backup_swift_region_name or"},{"line_number":230,"context_line":"                                    endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":231,"context_line":"                                    CONF.backup_swift_region_name):"},{"line_number":232,"context_line":"                                self.auth_url \u003d endpoint.get(endpoint_type)"}],"source_content_type":"text/x-python","patch_set":3,"id":"6909adc2_60f30998","line":229,"updated":"2026-01-27 11:07:11.000000000","message":"I\u0027m not that familiar with the codebase, but I noticed that the Glance option uses a proper [glance] config group (CONF[GLANCE_GROUP].region_name), but the Swift option uses the default group (CONF.backup_swift_region_name).","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ce0e974f6091484fab6ad3600b8634577d5c581e","unresolved":false,"context_lines":[{"line_number":226,"context_line":"                        # the service catalog, so once the correct one is found"},{"line_number":227,"context_line":"                        # it is safe to break out of the loop"},{"line_number":228,"context_line":"                        for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":229,"context_line":"                            if (not CONF.backup_swift_region_name or"},{"line_number":230,"context_line":"                                    endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":231,"context_line":"                                    CONF.backup_swift_region_name):"},{"line_number":232,"context_line":"                                self.auth_url \u003d endpoint.get(endpoint_type)"}],"source_content_type":"text/x-python","patch_set":3,"id":"ed1b085d_220f057d","line":229,"in_reply_to":"6909adc2_60f30998","updated":"2026-01-27 19:08:50.000000000","message":"The glance section was added recently[1] since it was needed for service-to-service communication.\nFor swift, We configure the backup driver settings in the [DEFAULT] section since we currently don\u0027t support multi-backup backends deployment.\n\n[1] https://github.com/openstack/cinder/commit/9dfb500d5bb4fb6523731d7053a0424280d11da2","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"cdec4d309a906b6a4437edb5c126e2dc72ef29b1","unresolved":true,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"                        endpoint \u003d utils.get_region_filtered_endpoint("},{"line_number":233,"context_line":"                            endpoints, endpoint_type, region_name)"},{"line_number":234,"context_line":"                        if endpoints:"},{"line_number":235,"context_line":"                            self.auth_url \u003d endpoint"},{"line_number":236,"context_line":"                        break"},{"line_number":237,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"f84f72fa_cdeb394d","line":234,"range":{"start_line":234,"start_character":27,"end_line":234,"end_character":36},"updated":"2026-02-03 05:22:07.000000000","message":"it is possible that we have multiple endpoints but none of them match with the configured region name?\nThis means `if endpoints:` condition will evaluate to true but we will set\n    \n    self.auth_url \u003d None\n\nI\u0027m not saying this is wrong but is that what is intended with this logic?","commit_id":"e804a15ec3adda5b81dcba0160696c5f8229ca97"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"541f0af3b6f143148ce01283515eb69652215f54","unresolved":false,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"                        endpoint \u003d utils.get_region_filtered_endpoint("},{"line_number":233,"context_line":"                            endpoints, endpoint_type, region_name)"},{"line_number":234,"context_line":"                        if endpoints:"},{"line_number":235,"context_line":"                            self.auth_url \u003d endpoint"},{"line_number":236,"context_line":"                        break"},{"line_number":237,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"631b8a92_299162c0","line":234,"range":{"start_line":234,"start_character":27,"end_line":234,"end_character":36},"in_reply_to":"c4f91f6f_3af930ee","updated":"2026-02-03 14:15:07.000000000","message":"Ah okay right. So we will always have an endpoint if the endpoints list exist.\nSomehow, looking at the code doesn\u0027t make it obvious and I would\u0027ve expected the condition to be\n\n    if endpoint:\n        self.auth_url \u003d endpoint\n        \nAnyways, its a non-blocker for me.","commit_id":"e804a15ec3adda5b81dcba0160696c5f8229ca97"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"97df0fe80df2842f48ff71dc18f907fffb3ed183","unresolved":true,"context_lines":[{"line_number":231,"context_line":""},{"line_number":232,"context_line":"                        endpoint \u003d utils.get_region_filtered_endpoint("},{"line_number":233,"context_line":"                            endpoints, endpoint_type, region_name)"},{"line_number":234,"context_line":"                        if endpoints:"},{"line_number":235,"context_line":"                            self.auth_url \u003d endpoint"},{"line_number":236,"context_line":"                        break"},{"line_number":237,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":7,"id":"c4f91f6f_3af930ee","line":234,"range":{"start_line":234,"start_character":27,"end_line":234,"end_character":36},"in_reply_to":"f84f72fa_cdeb394d","updated":"2026-02-03 07:59:20.000000000","message":"This won\u0027t happen.  get_region_filtered_endpoint() will return the first endpoint in this case to conform with past behavior.  Whether this should be the behavior - or whether we should instead raise an exception, I leave to you to decide,","commit_id":"e804a15ec3adda5b81dcba0160696c5f8229ca97"}],"cinder/image/glance.py":[{"author":{"_account_id":14250,"name":"Grzegorz Grasza","email":"xek@redhat.com","username":"xek"},"change_message_id":"8839f95d987166b5d739fd17768926373425bcd0","unresolved":true,"context_lines":[{"line_number":182,"context_line":"                \"\u003cservice_type\u003e:\u003cservice_name\u003e:\u003cendpoint_type\u003e\"))"},{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":186,"context_line":"                    if (not CONF[GLANCE_GROUP].region_name or"},{"line_number":187,"context_line":"                            endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":188,"context_line":"                            CONF[GLANCE_GROUP].region_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"0a86ef00_3722395f","line":185,"updated":"2026-01-27 11:07:11.000000000","message":"I noticed this is different than in cinder/compute/nova.py (lines 72-80)\n\nSwift driver changes are good defensively using entry.get(\u0027endpoints\u0027, []), but this differs slightly from the Nova pattern which just uses service[\u0027endpoints\u0027]. The defensive approach is actually better, so we should change it in nova.py as a followup.","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"cf645ad8034c23f822ab8ab2538308d31d43796a","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                \"\u003cservice_type\u003e:\u003cservice_name\u003e:\u003cendpoint_type\u003e\"))"},{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":186,"context_line":"                    if (not CONF[GLANCE_GROUP].region_name or"},{"line_number":187,"context_line":"                            endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":188,"context_line":"                            CONF[GLANCE_GROUP].region_name):"}],"source_content_type":"text/x-python","patch_set":3,"id":"588f6756_851adf51","line":185,"in_reply_to":"0a86ef00_3722395f","updated":"2026-01-30 17:31:07.000000000","message":"Done","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ce0e974f6091484fab6ad3600b8634577d5c581e","unresolved":true,"context_lines":[{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":186,"context_line":"                    if (not CONF[GLANCE_GROUP].region_name or"},{"line_number":187,"context_line":"                            endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":188,"context_line":"                            CONF[GLANCE_GROUP].region_name):"},{"line_number":189,"context_line":"                        api_servers.append(endpoint.get(endpoint_type))"}],"source_content_type":"text/x-python","patch_set":3,"id":"096cfbdc_d73df898","line":186,"range":{"start_line":186,"start_character":24,"end_line":186,"end_character":58},"updated":"2026-01-27 19:08:50.000000000","message":"I\u0027m confused about this condition. If the user has not configured the region_name in the glance section then we will append all types of endpoints?\nThis seems different from the previous behavior where we only append the first endpoint type making it non backward compatible?\n\nTo me, the logical condition would be\n\n    for endpoint in entry.get(\u0027endpoints\u0027, []):\n        if (endpoint.get(\u0027region\u0027) \u003d\u003d CONF[GLANCE_GROUP].region_name):\n            # Append the region name that matches the configured region\n            api_servers.append(endpoint.get(endpoint_type))\n    if not api_servers:\n        # otherwise add the first endpoint type\n        entry.get(\u0027endpoints\u0027)[0].get(endpoint_type))\n        \nPlease correct me if my understanding is wrong about this","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0ef7e423650362cbed8f5054bb1d590445d8400e","unresolved":true,"context_lines":[{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":186,"context_line":"                    if (not CONF[GLANCE_GROUP].region_name or"},{"line_number":187,"context_line":"                            endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":188,"context_line":"                            CONF[GLANCE_GROUP].region_name):"},{"line_number":189,"context_line":"                        api_servers.append(endpoint.get(endpoint_type))"}],"source_content_type":"text/x-python","patch_set":3,"id":"6e744800_2160e41f","line":186,"range":{"start_line":186,"start_character":24,"end_line":186,"end_character":58},"in_reply_to":"096cfbdc_d73df898","updated":"2026-01-28 17:11:00.000000000","message":"yup.  good catch. fixing!","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"cf645ad8034c23f822ab8ab2538308d31d43796a","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                for endpoint in entry.get(\u0027endpoints\u0027, []):"},{"line_number":186,"context_line":"                    if (not CONF[GLANCE_GROUP].region_name or"},{"line_number":187,"context_line":"                            endpoint.get(\u0027region\u0027) \u003d\u003d"},{"line_number":188,"context_line":"                            CONF[GLANCE_GROUP].region_name):"},{"line_number":189,"context_line":"                        api_servers.append(endpoint.get(endpoint_type))"}],"source_content_type":"text/x-python","patch_set":3,"id":"143c6d4a_4e5b8de9","line":186,"range":{"start_line":186,"start_character":24,"end_line":186,"end_character":58},"in_reply_to":"6e744800_2160e41f","updated":"2026-01-30 17:31:07.000000000","message":"Done","commit_id":"f6c3335985c50d95746b254171749e9c56899569"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"60f6795b580312b70b4e4ede2b8901fde7f4ddaf","unresolved":true,"context_lines":[{"line_number":182,"context_line":"                \"\u003cservice_type\u003e:\u003cservice_name\u003e:\u003cendpoint_type\u003e\"))"},{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                region_name \u003d CONF[GLANCE_GROUP].region_name"},{"line_number":186,"context_line":"                endpoints \u003d entry.get(\u0027endpoints\u0027, [])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"                # First, try to filter by region if region_name is configured"},{"line_number":189,"context_line":"                matched_endpoint \u003d None"},{"line_number":190,"context_line":"                if region_name:"},{"line_number":191,"context_line":"                    for endpoint in endpoints:"},{"line_number":192,"context_line":"                        if endpoint.get(\u0027region\u0027) \u003d\u003d region_name:"},{"line_number":193,"context_line":"                            # Found endpoint that matches the configured region"},{"line_number":194,"context_line":"                            matched_endpoint \u003d endpoint.get(endpoint_type)"},{"line_number":195,"context_line":"                            break"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"                # If we found a matching endpoint, use it; otherwise use"},{"line_number":198,"context_line":"                # first endpoint (backward compatible behavior when"},{"line_number":199,"context_line":"                # region_name is not configured)"},{"line_number":200,"context_line":"                if matched_endpoint:"},{"line_number":201,"context_line":"                    api_servers.append(matched_endpoint)"},{"line_number":202,"context_line":"                elif endpoints:"},{"line_number":203,"context_line":"                    api_servers.append(endpoints[0].get(endpoint_type))"},{"line_number":204,"context_line":"                break"},{"line_number":205,"context_line":"    else:"},{"line_number":206,"context_line":"        for api_server in CONF.glance_api_servers:"},{"line_number":207,"context_line":"            api_servers.append(api_server)"}],"source_content_type":"text/x-python","patch_set":4,"id":"4021c12b_5cf75ccc","line":204,"range":{"start_line":185,"start_character":16,"end_line":204,"end_character":21},"updated":"2026-01-30 04:22:13.000000000","message":"nit: since this logic is repeated 3 times, I would prefer it to be a utils method","commit_id":"71e6d27af8991adcbac5143a97bb5edf8b9ae54e"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"82df5fb6e2755b19664c498752606b4ef932f3d7","unresolved":false,"context_lines":[{"line_number":182,"context_line":"                \"\u003cservice_type\u003e:\u003cservice_name\u003e:\u003cendpoint_type\u003e\"))"},{"line_number":183,"context_line":"        for entry in context.service_catalog:"},{"line_number":184,"context_line":"            if entry.get(\u0027type\u0027) \u003d\u003d service_type:"},{"line_number":185,"context_line":"                region_name \u003d CONF[GLANCE_GROUP].region_name"},{"line_number":186,"context_line":"                endpoints \u003d entry.get(\u0027endpoints\u0027, [])"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"                # First, try to filter by region if region_name is configured"},{"line_number":189,"context_line":"                matched_endpoint \u003d None"},{"line_number":190,"context_line":"                if region_name:"},{"line_number":191,"context_line":"                    for endpoint in endpoints:"},{"line_number":192,"context_line":"                        if endpoint.get(\u0027region\u0027) \u003d\u003d region_name:"},{"line_number":193,"context_line":"                            # Found endpoint that matches the configured region"},{"line_number":194,"context_line":"                            matched_endpoint \u003d endpoint.get(endpoint_type)"},{"line_number":195,"context_line":"                            break"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"                # If we found a matching endpoint, use it; otherwise use"},{"line_number":198,"context_line":"                # first endpoint (backward compatible behavior when"},{"line_number":199,"context_line":"                # region_name is not configured)"},{"line_number":200,"context_line":"                if matched_endpoint:"},{"line_number":201,"context_line":"                    api_servers.append(matched_endpoint)"},{"line_number":202,"context_line":"                elif endpoints:"},{"line_number":203,"context_line":"                    api_servers.append(endpoints[0].get(endpoint_type))"},{"line_number":204,"context_line":"                break"},{"line_number":205,"context_line":"    else:"},{"line_number":206,"context_line":"        for api_server in CONF.glance_api_servers:"},{"line_number":207,"context_line":"            api_servers.append(api_server)"}],"source_content_type":"text/x-python","patch_set":4,"id":"89db8c12_a8aba368","line":204,"range":{"start_line":185,"start_character":16,"end_line":204,"end_character":21},"in_reply_to":"4021c12b_5cf75ccc","updated":"2026-01-30 19:59:45.000000000","message":"done","commit_id":"71e6d27af8991adcbac5143a97bb5edf8b9ae54e"}],"cinder/tests/unit/backup/drivers/test_backup_swift.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"a8df057ba26a8b8802e369225164b23ce431db2e","unresolved":true,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def test_backup_swift_region_filtering(self):"},{"line_number":197,"context_line":"        \"\"\"Test that region_name filters Swift endpoints correctly.\"\"\""},{"line_number":198,"context_line":"        self.ctxt.service_catalog \u003d [{u\u0027type\u0027: u\u0027object-store\u0027,"},{"line_number":199,"context_line":"                                      u\u0027name\u0027: u\u0027swift\u0027,"},{"line_number":200,"context_line":"                                      u\u0027endpoints\u0027: ["},{"line_number":201,"context_line":"                                          {u\u0027region\u0027: u\u0027regionOne\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"469859cc_4694079e","line":198,"range":{"start_line":198,"start_character":38,"end_line":198,"end_character":40},"updated":"2026-01-21 13:27:04.000000000","message":"Probably could skip all the u\u0027 specifiers","commit_id":"6a297f9631a0f07815dac14ca3f401043ef81c42"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"0c9533e8e78d49daf1f3f12ddede8a396cc0f2ad","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"    def test_backup_swift_region_filtering(self):"},{"line_number":197,"context_line":"        \"\"\"Test that region_name filters Swift endpoints correctly.\"\"\""},{"line_number":198,"context_line":"        self.ctxt.service_catalog \u003d [{u\u0027type\u0027: u\u0027object-store\u0027,"},{"line_number":199,"context_line":"                                      u\u0027name\u0027: u\u0027swift\u0027,"},{"line_number":200,"context_line":"                                      u\u0027endpoints\u0027: ["},{"line_number":201,"context_line":"                                          {u\u0027region\u0027: u\u0027regionOne\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"ce9064a4_f50ab64b","line":198,"range":{"start_line":198,"start_character":38,"end_line":198,"end_character":40},"in_reply_to":"469859cc_4694079e","updated":"2026-01-23 20:49:18.000000000","message":"Done","commit_id":"6a297f9631a0f07815dac14ca3f401043ef81c42"}],"cinder/utils.py":[{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"0e10416ccc876e1cc1080b822b26ab5280b04c87","unresolved":true,"context_lines":[{"line_number":73,"context_line":"synchronized_remove \u003d lockutils.remove_external_lock_file_with_prefix("},{"line_number":74,"context_line":"    \u0027cinder-\u0027)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def get_region_filtered_endpoint(endpoints, endpoint_type, region_name\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Return an endpoint URL filtered by region with a fallback."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    If region_name is provided, return the first endpoint URL that matches"},{"line_number":81,"context_line":"    the region. If no match is found (or region_name is not set), fall back"},{"line_number":82,"context_line":"    to the first endpoint in the list. Returns None if endpoints is empty."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":"    matched_endpoint \u003d None"},{"line_number":85,"context_line":"    if region_name:"},{"line_number":86,"context_line":"        for endpoint in endpoints or []:"},{"line_number":87,"context_line":"            if endpoint.get(\u0027region\u0027) \u003d\u003d region_name:"},{"line_number":88,"context_line":"                matched_endpoint \u003d endpoint.get(endpoint_type)"},{"line_number":89,"context_line":"                break"},{"line_number":90,"context_line":"    if matched_endpoint:"},{"line_number":91,"context_line":"        return matched_endpoint"},{"line_number":92,"context_line":"    if endpoints:"},{"line_number":93,"context_line":"        return endpoints[0].get(endpoint_type)"},{"line_number":94,"context_line":"    return None"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def clean_volume_file_locks(volume_id, driver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"b3dc188b_094a1df2","line":94,"range":{"start_line":76,"start_character":0,"end_line":94,"end_character":15},"updated":"2026-02-02 07:04:09.000000000","message":"This is logically correct but I would like this to be rewritten in a more readable way\n\n\n    def get_region_filtered_endpoint(endpoints, endpoint_type, region_name\u003dNone):\n        \"\"\"Return an endpoint URL filtered by region with a fallback.\n\n        If region_name is provided, return the first endpoint URL that matches\n        the region. If no match is found (or region_name is not set), fall back\n        to the first endpoint in the list. Returns None if endpoints is empty.\n        \"\"\"\n        endpoints \u003d endpoints or []\n        if region_name:\n            for endpoint in endpoints:\n                if endpoint.get(\u0027region\u0027) \u003d\u003d region_name:\n                    return endpoint[endpoint_type]\n        if endpoints:\n            return endpoints[0].get(endpoint_type)","commit_id":"8a53ae9910db97fa0af51341cd037bc1388b39d7"},{"author":{"_account_id":9914,"name":"Ade Lee","email":"alee@redhat.com","username":"alee"},"change_message_id":"97df0fe80df2842f48ff71dc18f907fffb3ed183","unresolved":false,"context_lines":[{"line_number":73,"context_line":"synchronized_remove \u003d lockutils.remove_external_lock_file_with_prefix("},{"line_number":74,"context_line":"    \u0027cinder-\u0027)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"def get_region_filtered_endpoint(endpoints, endpoint_type, region_name\u003dNone):"},{"line_number":78,"context_line":"    \"\"\"Return an endpoint URL filtered by region with a fallback."},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"    If region_name is provided, return the first endpoint URL that matches"},{"line_number":81,"context_line":"    the region. If no match is found (or region_name is not set), fall back"},{"line_number":82,"context_line":"    to the first endpoint in the list. Returns None if endpoints is empty."},{"line_number":83,"context_line":"    \"\"\""},{"line_number":84,"context_line":"    matched_endpoint \u003d None"},{"line_number":85,"context_line":"    if region_name:"},{"line_number":86,"context_line":"        for endpoint in endpoints or []:"},{"line_number":87,"context_line":"            if endpoint.get(\u0027region\u0027) \u003d\u003d region_name:"},{"line_number":88,"context_line":"                matched_endpoint \u003d endpoint.get(endpoint_type)"},{"line_number":89,"context_line":"                break"},{"line_number":90,"context_line":"    if matched_endpoint:"},{"line_number":91,"context_line":"        return matched_endpoint"},{"line_number":92,"context_line":"    if endpoints:"},{"line_number":93,"context_line":"        return endpoints[0].get(endpoint_type)"},{"line_number":94,"context_line":"    return None"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def clean_volume_file_locks(volume_id, driver):"}],"source_content_type":"text/x-python","patch_set":6,"id":"b75ac0c4_3bcf9ba3","line":94,"range":{"start_line":76,"start_character":0,"end_line":94,"end_character":15},"in_reply_to":"b3dc188b_094a1df2","updated":"2026-02-03 07:59:20.000000000","message":"Done","commit_id":"8a53ae9910db97fa0af51341cd037bc1388b39d7"}]}
