)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"a8a2a0404c2fc578c462adda23823d78f68234e6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e0fe89ec_273758bc","updated":"2026-01-08 15:54:51.000000000","message":"Can you create a bug on Launchpad so we can refer to it in case we want to backport this?","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"ecaf884643898f624e6904e675ffd0380f9f306c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"1397af84_ee47e647","updated":"2026-01-09 10:29:47.000000000","message":"Looks like the glance-grenade-centralized-cache and glance-s3-multistore jobs haven\u0027t passed in a while, so I don\u0027t think the failures are related to this patch.","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"d3944cb77f4e21418fa2b9f26aeaf5cb00e46144","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"2ec5c531_da4338bd","updated":"2026-01-08 15:45:42.000000000","message":"Thanks!","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":38723,"name":"Mathieu Tortuyaux","display_name":"tormath1","email":"mathieu.tortuyaux@gmail.com","username":"tormath1"},"change_message_id":"884aca2d5bc041702b9cac2b039079805c41e5ab","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"60a8f89f_4b200686","in_reply_to":"0e4eebc4_c213db3c","updated":"2026-03-09 11:07:42.000000000","message":"Hey @cyril@redhat.com and @m.andre@redhat.com - any chance to have a second look on this patch? It has been rebased on current `master`. Thanks :)","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":39045,"name":"Urs Schaufelberger","display_name":"Urs Schaufelberger","email":"urs@cloudscale.ch","username":"urs"},"change_message_id":"bdd0b39f0b705249aa1838978f2c22733becc308","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"e442a23c_9897c4a0","in_reply_to":"60a8f89f_4b200686","updated":"2026-04-17 08:52:49.000000000","message":"Any update on this? \n\nThe inability to import images from URLs behind Cloudflare is causing increasing issues","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"ecaf884643898f624e6904e675ffd0380f9f306c","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"eeb9731e_9d02419d","in_reply_to":"61cc80f3_74788473","updated":"2026-01-09 10:29:47.000000000","message":"Yes, you should add `Closes-Bug: #2137731` to the commit message, per https://wiki.openstack.org/wiki/GitCommitMessages","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":38723,"name":"Mathieu Tortuyaux","display_name":"tormath1","email":"mathieu.tortuyaux@gmail.com","username":"tormath1"},"change_message_id":"067007063c653be06f89ddedc8db7588f19b3b14","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"61cc80f3_74788473","in_reply_to":"e0fe89ec_273758bc","updated":"2026-01-08 16:59:40.000000000","message":"Hey @cyril@redhat.com thanks for the suggestion, here\u0027s the Launchpad entry: https://bugs.launchpad.net/glance/+bug/2137731 - should I amend the commit to mention it?","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":38723,"name":"Mathieu Tortuyaux","display_name":"tormath1","email":"mathieu.tortuyaux@gmail.com","username":"tormath1"},"change_message_id":"332d39035c493cabb38c3cbc3438a1846d0fc877","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":4,"id":"0e4eebc4_c213db3c","in_reply_to":"eeb9731e_9d02419d","updated":"2026-01-09 12:55:42.000000000","message":"Thanks for the documentation link, this is useful. Commit message has been updated consequently.","commit_id":"742ad15ac6901536f4d48f0f6c54494223da0dce"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"375097453929d0663a2dc51c9ffab1adc6bd0d02","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"b94acfcb_33d3d47e","updated":"2026-04-27 15:06:46.000000000","message":"The failing test `glance.tests.unit.common.scripts.test_scripts_utils.TestGetImageDataIter.test_get_image_data_iter_http_uri` needs below changes to work;\n\n\n```\n+++ b/glance/tests/unit/common/scripts/test_scripts_utils.py\n@@ -340,7 +340,11 @@ class TestGetImageDataIter(test_utils.BaseTestCase):\n             found_handler,\n             \"SafeRedirectHandler should be passed to build_opener\")\n \n-        mock_opener.open.assert_called_once_with(\"http://example.com/image\")\n+        mock_opener.open.assert_called_once()\n+        (req_arg,), _ \u003d mock_opener.open.call_args\n+        self.assertIsInstance(req_arg, urllib.request.Request)\n+        self.assertEqual(req_arg.full_url, \"http://example.com/image\")\n+        self.assertEqual(req_arg.headers.get(\"User-agent\"), \"glance-client\")\n```","commit_id":"3765ad08be3cb3339751ea9e10dc97bbf7c67a81"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"3c69649d3f7e4c1a3e3642ae3fe1725aa853a77c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":15,"id":"2d05db9f_c23a7632","updated":"2026-09-18 15:13:13.000000000","message":"So I think you want to add a user agent to *every* call to open_external_uri? If so, you are missing some:\n\n    glance/async_/flows/_internal_plugins/glance_download.py:            data \u003d script_utils.open_external_uri(request)\n    glance/async_/flows/api_image_import.py:            with script_utils.open_external_uri(request) as payload:\n    glance/async_/flows/ovf_process.py:        return script_utils.open_external_uri(uri)\n    glance/common/scripts/utils.py:    urlopen \u003d open_external_uri(uri)\n\n\nI read in https://docs.python.org/3/library/urllib.request.html#module-urllib.request that \"OpenerDirector automatically adds a User-Agent header to every Request\" and that it can be changed, with the following code snipper as example:\n\n    import urllib.request\n    opener \u003d urllib.request.build_opener()\n    opener.addheaders \u003d [(\u0027User-agent\u0027, \u0027Mozilla/5.0\u0027)]\n    with opener.open(\u0027http://www.example.com/\u0027) as f:\n       print(f.read().decode(\u0027utf-8\u0027))\n\nCould we not use opener.addheaders in open_external_uri?","commit_id":"517514fe3728db21d4d6417bf22bd0c6ec9306de"},{"author":{"_account_id":38723,"name":"Mathieu Tortuyaux","display_name":"tormath1","email":"mathieu.tortuyaux@gmail.com","username":"tormath1"},"change_message_id":"fa11874d37f91be7404e32cb5aeeb26e65e7a4e7","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":15,"id":"cc3bb45e_0e65cecb","in_reply_to":"2d05db9f_c23a7632","updated":"2026-09-29 12:27:06.000000000","message":"Hi @cyril@redhat.com and thanks for your input. The goal here is to provide this header when it comes to download images, so not every call to open_external_uri.\nOf course we could add it to open_external_uri but I would like to limit the side effects of this contribution (even if there is no reason to break things by settings this kind of header).\n\nLet me know what you think is best.","commit_id":"517514fe3728db21d4d6417bf22bd0c6ec9306de"}],"glance/async_/flows/ovf_process.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"6a8f935e891796d196db788d134975398e7d401a","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            return open(uri, \"rb\")"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Override \u0027User-agent\u0027 header to avoid CloudFlare 403 errors."},{"line_number":79,"context_line":"        req \u003d urllib.request.Request("},{"line_number":80,"context_line":"            uri,"},{"line_number":81,"context_line":"            headers\u003d{\u0027User-agent\u0027: \u0027glance-client\u0027},"},{"line_number":82,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":12,"id":"99bbf078_f7640499","line":79,"updated":"2026-09-10 09:58:32.000000000","message":"pep8: F821 undefined name \u0027urllib\u0027","commit_id":"69d9ca478ba0bb54112e7f4247df066519db1625"}],"glance/common/scripts/utils.py":[{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"0b04c952d59e769b925a5a60047b8ada3e5c0a78","unresolved":true,"context_lines":[{"line_number":149,"context_line":"        return open(uri, \"rb\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    # Override \u0027User-agent\u0027 header to avoid CloudFlare 403 errors."},{"line_number":152,"context_line":"    req \u003d urllib.request.Request(uri, headers\u003d{\u0027User-agent\u0027: \u0027glance-client\u0027})"},{"line_number":153,"context_line":"    return urllib.request.urlopen(req)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"d6607eb8_2f8d82b5","line":152,"updated":"2026-01-07 16:05:30.000000000","message":"Are there potentially other places where the User-agent should be added?\n\nA quick search on github shows a few more places: https://github.com/search?q\u003drepo%3Aopenstack%2Fglance+urllib.request\u0026type\u003dcode","commit_id":"e3203c52c5b81be82d70ce56fc696f07caa6a133"},{"author":{"_account_id":13039,"name":"Martin André","email":"m.andre@redhat.com","username":"mandre"},"change_message_id":"03d015bb95dcbb68ae1fd7e16a13f4a12b78131a","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        return open(uri, \"rb\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    # Override \u0027User-agent\u0027 header to avoid CloudFlare 403 errors."},{"line_number":152,"context_line":"    req \u003d urllib.request.Request(uri, headers\u003d{\u0027User-agent\u0027: \u0027glance-client\u0027})"},{"line_number":153,"context_line":"    return urllib.request.urlopen(req)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"17406a1b_50a43b7c","line":152,"in_reply_to":"07c2492b_022131c8","updated":"2026-08-26 07:27:26.000000000","message":"Done","commit_id":"e3203c52c5b81be82d70ce56fc696f07caa6a133"},{"author":{"_account_id":38723,"name":"Mathieu Tortuyaux","display_name":"tormath1","email":"mathieu.tortuyaux@gmail.com","username":"tormath1"},"change_message_id":"d72101a1235ababa72d10449699276ae305e593f","unresolved":true,"context_lines":[{"line_number":149,"context_line":"        return open(uri, \"rb\")"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    # Override \u0027User-agent\u0027 header to avoid CloudFlare 403 errors."},{"line_number":152,"context_line":"    req \u003d urllib.request.Request(uri, headers\u003d{\u0027User-agent\u0027: \u0027glance-client\u0027})"},{"line_number":153,"context_line":"    return urllib.request.urlopen(req)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"07c2492b_022131c8","line":152,"in_reply_to":"d6607eb8_2f8d82b5","updated":"2026-01-08 11:53:52.000000000","message":"I think the `X-Auth-Token` header means \"internal API calls\" (w/ authentication) - but yeah for the `ovf_process.py` I guess it makes sense.","commit_id":"e3203c52c5b81be82d70ce56fc696f07caa6a133"}],"glance/tests/unit/async_/flows/test_ovf_process.py":[{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"672353a663f96750810aec51a417641fc256c17c","unresolved":false,"context_lines":[{"line_number":178,"context_line":"                          \u0027http://127.0.0.1:5000/package.ova\u0027)"},{"line_number":179,"context_line":"        mock_open.assert_called_once()"},{"line_number":180,"context_line":"        (req_arg,), _ \u003d mock_open.call_args"},{"line_number":181,"context_line":"        self.assertIsInstance(req_arg, urllib.request.Request)"},{"line_number":182,"context_line":"        self.assertEqual(req_arg.full_url, \"http://127.0.0.1:5000/package.ova\")"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"    @mock.patch(\u0027glance.common.scripts.utils.open_external_uri\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1eeeb7e8_93f1031d","line":181,"updated":"2026-09-10 14:28:33.000000000","message":"pep8: F821 undefined name \u0027urllib\u0027","commit_id":"57a51b3bb24d835014d3bad8a00309a8163ef6f9"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"672353a663f96750810aec51a417641fc256c17c","unresolved":false,"context_lines":[{"line_number":193,"context_line":"        self.assertEqual(mock_response, result)"},{"line_number":194,"context_line":"        mock_open.assert_called_once()"},{"line_number":195,"context_line":"        (req_arg,), _ \u003d mock_open.call_args"},{"line_number":196,"context_line":"        self.assertIsInstance(req_arg, urllib.request.Request)"},{"line_number":197,"context_line":"        self.assertEqual(req_arg.full_url, \"http://example.com/package.ova\")"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    @mock.patch(\u0027glance.common.scripts.utils.open_external_uri\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"d1820ab6_418f7b64","line":196,"updated":"2026-09-10 14:28:33.000000000","message":"pep8: F821 undefined name \u0027urllib\u0027","commit_id":"57a51b3bb24d835014d3bad8a00309a8163ef6f9"},{"author":{"_account_id":22348,"name":"Zuul","username":"zuul","tags":["SERVICE_USER"]},"tag":"autogenerated:zuul:check","change_message_id":"672353a663f96750810aec51a417641fc256c17c","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                          \u0027http://example.com/package.ova\u0027)"},{"line_number":209,"context_line":"        mock_open.assert_called_once()"},{"line_number":210,"context_line":"        (req_arg,), _ \u003d mock_open.call_args"},{"line_number":211,"context_line":"        self.assertIsInstance(req_arg, urllib.request.Request)"},{"line_number":212,"context_line":"        self.assertEqual(req_arg.full_url, \"http://example.com/package.ova\")"}],"source_content_type":"text/x-python","patch_set":14,"id":"0000bd49_d568542d","line":211,"updated":"2026-09-10 14:28:33.000000000","message":"pep8: F821 undefined name \u0027urllib\u0027","commit_id":"57a51b3bb24d835014d3bad8a00309a8163ef6f9"}]}
