)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"286206c79c16e2fb58813b68745b55c64e5f1dd1","unresolved":true,"context_lines":[{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Id5482582a29d947dcb74a506bf715cf6a2d05b3e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"c7196cae_271e7ff4","line":12,"updated":"2023-08-09 17:24:11.000000000","message":"related-blueprint tag","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Change-Id: Id5482582a29d947dcb74a506bf715cf6a2d05b3e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":14,"id":"81408a65_98940a51","line":12,"in_reply_to":"c7196cae_271e7ff4","updated":"2023-08-14 11:52:08.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Add Location Import task flow"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Related blueprint new-location-apis"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"ecdbc1b7_1ee83519","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":38},"updated":"2023-08-21 05:58:09.000000000","message":"I think this will change now","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add Location Import task flow"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Related blueprint new-location-apis"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"e3c21e4e_b6ed9f48","line":10,"range":{"start_line":10,"start_character":0,"end_line":10,"end_character":38},"in_reply_to":"ecdbc1b7_1ee83519","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a005aa5860e977455c8d4e42c00cb1dd87aac4ae","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Add Location Import task flow"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Related blueprint new-location-apis"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"04cc3534_3faf98a0","line":10,"updated":"2023-08-29 16:55:43.000000000","message":"nit: this workflow include other tasks as well.","commit_id":"e59335a69ccf8e0311467b706247873f4a6af9fc"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"71ddf9e8cc45a6e631986398cc19c1d550869efe","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Add Location Import task flow"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This change adds location_import task flow which includes"},{"line_number":10,"context_line":"CalculateHash and VerifyValidationData tasks"},{"line_number":11,"context_line":"which are required for new add location api."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Related blueprint new-location-apis"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":23,"id":"1062ff78_d7ad45c2","line":10,"in_reply_to":"04cc3534_3faf98a0","updated":"2023-08-29 18:41:12.000000000","message":"Done","commit_id":"e59335a69ccf8e0311467b706247873f4a6af9fc"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"efb3c0dd_2cf8b8f3","updated":"2023-06-22 14:07:19.000000000","message":"Thanks for getting this going so quick. Looks like a good start. Just a few comments.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"1099509a_510c201e","updated":"2023-06-23 14:33:33.000000000","message":"This should be part of base patch IMHO (https://review.opendev.org/c/openstack/glance/+/881940/18)","commit_id":"c4714f499e3cf2d1cf482a1e0689037814682ef8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"2e6cce54318d0562cdc7136022b017783be74161","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":6,"id":"0e104c38_52e30679","updated":"2023-06-29 18:29:13.000000000","message":"recheck timeouts are unrelated","commit_id":"2702eec4044ec9aab505799ad938b0b09d1cb6ee"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a9c81f8b308d9e131ccef9df87b985784be0e160","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"7c4f0919_10ccbfe3","updated":"2023-07-19 16:12:04.000000000","message":"recheck tempest timed out but was making progress","commit_id":"a6784eac74977adb4e5209d7f8d270b947d52fe3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cfdc6612bfdb6b9bf3c2b32de7da45cd983a3c09","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"4d03f080_d4e35ea3","updated":"2023-07-20 17:54:33.000000000","message":"At least one of these timeouts actually has test failures in it with long cleanup loops that fail to ever do their thing. So I\u0027m guessing that\u0027s why the job actually timed out, because we spent a lot of time trying to clean up after a (cinder) failure and then ended up timing out the rest of the job after that:\n\nhttps://storage.gra.cloud.ovh.net/v1/AUTH_dcaab5e32b234d56b626f72581e3644c/zuul_opendev_logs_702/886749/8/check/glance-multistore-cinder-import/70217e0/job-output.txt","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"3a975714_2b2bace2","updated":"2023-07-28 10:22:15.000000000","message":"Thanks for review!","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8743e949d886858e440349f0ec8714993d4287fd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"4cb230c3_17e1a555","updated":"2023-07-25 05:49:29.000000000","message":"recheck timeouts","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a1a836150dfa32a41c4e279dd1af60eb3ec55ac8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"3a49e274_d4031a1a","in_reply_to":"151aa0f0_b875bd24","updated":"2023-07-21 13:32:15.000000000","message":"Yeah, I\u0027m not trying to say they\u0027re because of this patch, I\u0027m trying to characterize them. Most of our timeouts are not because of test failures, but because of uneven worker distribution, slow storage, etc, and are harder to resolve. Timeouts like the ones in this report are actually test failures that caused us to time out before we even finished. Those are tests that could be debugged and fixed to improve the situation.\n\nMeaning, it\u0027s worth digging into the *reason* they failed.","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"14061081fd855684317ab289e2ed5eac9e48c3dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":8,"id":"151aa0f0_b875bd24","in_reply_to":"4d03f080_d4e35ea3","updated":"2023-07-21 11:06:07.000000000","message":"Yeah most of the timeouts are during cleanups, on store weight patch as well found the same so definitely not because this particular change only,\nhttps://facb90543c36d5b8a98d-34bf5bc72e41fef0a101a5e104701e03.ssl.cf1.rackcdn.com/886811/6/check/glance-multistore-cinder-import/af3069b/testr_results.html","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":9,"id":"2825d19e_8eeb7410","updated":"2023-07-31 11:49:14.000000000","message":"Few comments inline","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"67107281_20cf7e91","updated":"2023-08-03 05:46:05.000000000","message":"Thanks for the review!","commit_id":"051aab063a101c52a532910ec1f1770918b06771"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5d3553849eea173108b920882df930d8f0f3c250","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":11,"id":"afbd2740_d256405f","updated":"2023-08-03 08:50:58.000000000","message":"recheck cinder related failure","commit_id":"051aab063a101c52a532910ec1f1770918b06771"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":16,"id":"bd2a35d6_120f5aac","updated":"2023-08-17 14:31:27.000000000","message":"A few nitpicks but I\u0027m mostly worried about the handling of IOError. Otherwise looks good!","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"e543ae6e_add48374","updated":"2023-08-21 05:58:09.000000000","message":"Few suggestions and nits","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"115bc3825209f0ada1b063bfd458385f9f812918","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":19,"id":"8ded7604_88136acc","updated":"2023-08-28 05:49:32.000000000","message":"Looks good to me!\nI think we are missing coverage for task input validation, but that can be added later.","commit_id":"c72a63437cac3800fdffb8d5769c44bc661ff5c7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ef2f79dc0a79c32d4dc04afe8e9ccdf50a5c5181","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"dc7e9162_2f7a0363","updated":"2023-08-28 09:50:19.000000000","message":"Now I know why dan was insisting for tempest tests from the beginning.","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c40e29f994e330fd34ebb249973292c7f16519de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":20,"id":"be04a71a_f32310ac","updated":"2023-08-28 12:29:04.000000000","message":"Thanks for review Abhishek !","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"7ad5de63097d901f60508798eff2176d285b15ca","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":23,"id":"cac0a9bd_6ad56688","updated":"2023-08-29 16:36:26.000000000","message":"recheck pep8 post failure","commit_id":"e59335a69ccf8e0311467b706247873f4a6af9fc"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a2db449e4fdc68d6c070a4e9880636842934b1da","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":26,"id":"8131b2d8_7b758576","updated":"2023-08-31 10:05:18.000000000","message":"recheck on connection issue on resize_volume_backed_server_confirm tempest test","commit_id":"01154625d0bfebae7855b0c21c282fa2b9d07655"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"2efc4bfbb48a8ba6b3727189e9a5bf99007a8269","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"044355d1_8a8c56fc","updated":"2023-09-20 08:42:12.000000000","message":"recheck","commit_id":"a1eb199229d41269f4d945b8c46ee2100eba81ec"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"875ce274dd0e35ddf6669745dcf7b73c29e3674e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":27,"id":"fe1e5029_48242221","updated":"2023-09-21 06:44:34.000000000","message":"recheck resource failed to reach to expected status for tempest integrated storegae \u0026 g-api-r service failed to start on multistore cinder import job","commit_id":"a1eb199229d41269f4d945b8c46ee2100eba81ec"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"849b71a6342b104a0976b061cb73eb1e120cc0a6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"f272bffe_e6b84754","updated":"2023-10-26 15:00:04.000000000","message":"Can you please close existing comments or reply them accordingly?","commit_id":"dcb543aee27acab86313292c1e0768e02e404f61"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f57743c6661d900743ec17b3daafbef924b4cb02","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"7dc4b3ba_9b72c401","updated":"2023-10-19 09:54:04.000000000","message":"recheck on storage import standalone timeout","commit_id":"dcb543aee27acab86313292c1e0768e02e404f61"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a50daee30b00f7d1ba51f827ce962f26389d0978","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":29,"id":"a26ff49a_bf13d0c0","updated":"2023-11-03 09:49:12.000000000","message":"recheck on failures due to db connection error and multiple timeouts","commit_id":"a064352a4853049b5974a754087e925c6ec1a32d"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"22d23b377c2e6aa1088c5825cc6b2e8e2132a2de","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":29,"id":"1ba77a58_e0afb05b","updated":"2023-11-07 12:19:40.000000000","message":"recheck on glance multistore cinder import failure","commit_id":"a064352a4853049b5974a754087e925c6ec1a32d"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f2ecdf9141ad8b3316105b930bba283b766087d1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"4ef5fdf2_048dfbf0","updated":"2024-01-03 11:30:17.000000000","message":"recheck on nova ceph multistore tests for server build failure due to no enough host available.","commit_id":"34fb6910080ee336de536666cf4f2b0c72d32195"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"64b48e42ff071d439318916a80804a18d9f55a16","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":32,"id":"fdef031d_fddb7c3c","updated":"2024-01-04 06:21:34.000000000","message":"recheck timeout on enforce scope new defaults","commit_id":"34fb6910080ee336de536666cf4f2b0c72d32195"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"942b2726d7ab5a2d602b1bb1695a642ffef3e4dd","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":33,"id":"20769898_78c54b1e","updated":"2024-01-17 14:26:25.000000000","message":"Dan, Thanks for the review.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":33,"id":"fb86a9c4_9b474746","updated":"2024-01-16 15:22:31.000000000","message":"Some concerns about the NotFound handling and some nits...","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e66b2d701e7e164462028033c1c491f8f6aec3f8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":34,"id":"3163ba81_ccc8bd41","updated":"2024-01-22 14:59:48.000000000","message":"My comment just now makes me wonder: Aren\u0027t we waiting for at least unit tests on all the content of this? There\u0027s patch to add functional tests later in this series, I assume because it needs the api bits to be in place, but there is a lot here that is not covered by that. Surely we\u0027re not going to land this without a single test right? We have more detailed unit tests for the other import tasks, so I would expect to have them for this as well:\n\nhttps://github.com/openstack/glance/tree/master/glance/tests/unit/async_/flows\n\nThere are also several other things here (like the utils and schema changes) that aren\u0027t tested. If those are later in the series somewhere, I think we should move them back here instead of landing these with zero coverage. If we land this and the next patch, and then get hung up or run out of time - that\u0027s a lot of untested code added to the tree.\n\nApologies if I missed some other discussion or strategy for handling this. If so, please correct me.","commit_id":"1a0fe17a03190d9def6ed0914bf3b59159e332b1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"4786aa33fca74074e99681b4cbecdae6308284b3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":34,"id":"aa783cd9_740ec675","in_reply_to":"3163ba81_ccc8bd41","updated":"2024-01-23 11:19:07.000000000","message":"Well, those test I had added in next patch (add location API). But yeah it makes sense to have it here, so moved those tests here in this updated PS.","commit_id":"1a0fe17a03190d9def6ed0914bf3b59159e332b1"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"04faf2aa662f773d25e0abdb21b4587705318b94","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":35,"id":"ba37897d_3a241872","updated":"2024-01-23 14:53:54.000000000","message":"recheck something looks like it crashed, caused a failure and then we timed out the job","commit_id":"d7c0cf6658471e4562ad8933e9bc251a998cf67a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"e528317bfb084408f28f9b3b1e8c721c6ef009bf","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":36,"id":"077ced7d_d3489d34","updated":"2024-01-30 06:21:56.000000000","message":"recheck","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"095c3d54ed86a8b0cc2f4bf7f41c5501b2730b83","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":38,"id":"bf29807f_3b31824e","updated":"2024-02-12 22:38:40.000000000","message":"A few questions and suggestions","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ca389ca4bcd1029700c76aa0a8c57766b94f4a07","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":45,"id":"9fd3a6a7_a081e811","updated":"2024-02-26 16:51:46.000000000","message":"recheck","commit_id":"6adb0517c8c3118911ac76be3c684d64fab42b0f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"516cab497a55ce43734263a0e4f4468c26c430ee","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":45,"id":"2342a8c1_9aa8344d","updated":"2024-02-26 14:19:16.000000000","message":"recheck since fips job is non-voting now https://review.opendev.org/c/openstack/glance/+/910147","commit_id":"6adb0517c8c3118911ac76be3c684d64fab42b0f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d91f93717510b2b13c2e91e56c4e62d0fd0e70cb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":46,"id":"75ef4149_537f2ff1","updated":"2024-02-27 11:25:44.000000000","message":"Could you please resolve/close existing open comments,\nThank you!","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":46,"id":"4c128022_6ec83070","in_reply_to":"75ef4149_537f2ff1","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":48,"id":"73a2eb4a_a07b79e4","updated":"2024-02-27 16:59:18.000000000","message":"Some questions regarding the use of getattr/setattr: are there cases where an image would not have the checksum/os_hash_algo/os_hash_value attributes?","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"f8a402da_93e067ef","updated":"2024-02-28 03:52:24.000000000","message":"Thanks for the review !!","commit_id":"cd5d2b25649f9929224f6b33f04651792f1dea80"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"7d891296a26deedde1c1e68c689c74216998dd73","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":49,"id":"db209cc3_6ad2f581","updated":"2024-02-28 07:03:42.000000000","message":"recheck timeouts on tempest-integrated-storage","commit_id":"cd5d2b25649f9929224f6b33f04651792f1dea80"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"308829f3539121c195563692f97ea17b80986d54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":50,"id":"3ef80943_0d63c354","updated":"2024-02-28 10:19:21.000000000","message":"One suggestion in Unit test else looks good to me.\nI am trusting that all scenarios of nova and cinder are working fine and has no regression.","commit_id":"3ff77f731fb982d2a21a096e0ffc92a2ac73e4d8"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"6e2caeedaf8f9786111952ca147c6ae362b24244","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":52,"id":"444a0686_8458b6b3","updated":"2024-02-28 18:12:49.000000000","message":"the upload volume operation failed because we removed passing context from here, i think we should include the cinder location fix and update the patch here else this will not work for cinder","commit_id":"e5dd051ff8fb8704238620c53000a8153300b415"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ac8efdeff17af0240a9b7443d93d035715d8b162","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":54,"id":"e8530d25_9e60be35","updated":"2024-02-28 19:29:32.000000000","message":"Thanks!","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"96b662595c4d6e4259e13a76a7018f990f17656d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":54,"id":"cc42a031_b2e1ee2f","updated":"2024-02-28 22:46:38.000000000","message":"The \"phantom\" assertions in the tests are worse than harmless!","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c804e6db3659d5ea4056307c07bcf54ce9ddd8e6","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":57,"id":"d23ed4d4_15c3573e","updated":"2024-04-04 14:39:08.000000000","message":"Dan, Thanks for the quick response ! 😊","commit_id":"8e945bbef169c16c5e2eaecc34e4caea00ccf530"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e2d13e5644ef6d2e54cce02019c82daf72a0dc0b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":64,"id":"f53844fb_0b2a18aa","updated":"2024-06-14 07:12:31.000000000","message":"Ignore my last comment","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"af4c4167a00af56f57b907b0dca55d189cdebdab","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":64,"id":"5001de63_fbcdc27e","updated":"2024-06-14 08:01:58.000000000","message":"Thanks for the review Abhishek!","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"aa3229aeda1cd9766374fa20fb385a2c4fcd5f73","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":64,"id":"9fc35e3c_4f724dc3","updated":"2024-06-11 08:05:37.000000000","message":"recheck","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f289a1b8c3f5feb178082470a11601d45e78f1e1","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":65,"id":"e922c5d4_6cb6e06d","updated":"2024-06-14 10:36:19.000000000","message":"Thank you !","commit_id":"3bbdd481aca0c17d0f7a1130b3fc2d9bda35e3e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a8b73324aef56a7a2567bf61f891a41094be451d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":66,"id":"571a69ff_07b1d0e5","updated":"2024-06-25 06:02:03.000000000","message":"recheck","commit_id":"81972790b30d01086357cef1608b64f83ff8b0f7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"94cb6eafd8b2a091dc271e461c28199d3cef60c7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":67,"id":"5eebaeaa_3dacf553","updated":"2024-07-12 07:53:08.000000000","message":"Scenario 1 Verify checksum and hash_value\n\nNote: Disable new location API\n1. Create new image\n2. Boot instance\n3. Create image snapshot `image-snapshot`\n4. Download snapshot image - glance image-download --id \u003cID\u003e --file test.raw\n5. Calculate md5 and sha512 hash of above file\n\t$ md5sum test.raw\n\t$ sha512sum test.raw\n\nNow enable new location API on nova and glance, restart all glance and nova services\n6. Create new snapshot of instance form step 2 `image-snapshot-2`\n7. `image-snapshot-2` will be having checksum and sha512 hash value\n8. Compare these values with step 5\n\nshould they match or not? If yes then something is wrong with new location API, if not then why not?\n\nNOTE: both `image-snapshot` and `image-snapshot-2` has same size","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6195cad6338be89286280adbd20d118e1f11d98e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":67,"id":"bcef495b_28a7a92a","updated":"2024-06-28 12:47:26.000000000","message":"Thanks for the review!","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b34350d202abbf86ce1b93a615068d087385e1ea","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":67,"id":"c6b2dc69_e16b3ef2","updated":"2024-06-28 15:41:54.000000000","message":"Will not hold the patch for this comment, but ideally action_wrapper should have been used for the consistency purpose.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"26a855b1e7663c92c04a99af9f89c8667f206762","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":67,"id":"83d31b48_f5a326be","in_reply_to":"5eebaeaa_3dacf553","updated":"2024-07-12 09:26:57.000000000","message":"Tested this in local environment,\nchecksum and hash matches with each other.\n\nNo Impact of new API.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"12aed15feca95ab6a907e2d69de1425456ebc76a","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":72,"id":"a19f04a7_bdcca4fb","updated":"2024-07-25 13:50:38.000000000","message":"One nit, if new patch is needed otherwise change that while working on followup.\n\nNOTE to approver: Wait for nova results to give go ahead on DNM patches which is on top of this chain.","commit_id":"a0b7650c4b526ee10312499c5b4ce5e890ec5e81"}],"glance/api/v2/tasks.py":[{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"8e88d6acfd4c126e47188c7bbc03794e160a3233","unresolved":true,"context_lines":[{"line_number":352,"context_line":"        \"enum\": ["},{"line_number":353,"context_line":"            \"import\","},{"line_number":354,"context_line":"            \"api_image_import\","},{"line_number":355,"context_line":"            \"location_import\""},{"line_number":356,"context_line":"        ],"},{"line_number":357,"context_line":"        \"type\": \"string\""},{"line_number":358,"context_line":"    },"}],"source_content_type":"text/x-python","patch_set":65,"id":"d22aea3f_70695cdc","line":355,"range":{"start_line":355,"start_character":13,"end_line":355,"end_character":28},"updated":"2024-06-17 19:27:00.000000000","message":"It does not really matter too much, but it\u0027s usually good practice to always end a line like this with a comma, as it makes it easier to add new elements to the list in future patches.","commit_id":"3bbdd481aca0c17d0f7a1130b3fc2d9bda35e3e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6195cad6338be89286280adbd20d118e1f11d98e","unresolved":false,"context_lines":[{"line_number":352,"context_line":"        \"enum\": ["},{"line_number":353,"context_line":"            \"import\","},{"line_number":354,"context_line":"            \"api_image_import\","},{"line_number":355,"context_line":"            \"location_import\""},{"line_number":356,"context_line":"        ],"},{"line_number":357,"context_line":"        \"type\": \"string\""},{"line_number":358,"context_line":"    },"}],"source_content_type":"text/x-python","patch_set":65,"id":"ea5e385e_390e9505","line":355,"range":{"start_line":355,"start_character":13,"end_line":355,"end_character":28},"in_reply_to":"06045c2d_e5b468a0","updated":"2024-06-28 12:47:26.000000000","message":"Done","commit_id":"3bbdd481aca0c17d0f7a1130b3fc2d9bda35e3e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"902352e435b01a00a24790e47a92a9902c0fd346","unresolved":true,"context_lines":[{"line_number":352,"context_line":"        \"enum\": ["},{"line_number":353,"context_line":"            \"import\","},{"line_number":354,"context_line":"            \"api_image_import\","},{"line_number":355,"context_line":"            \"location_import\""},{"line_number":356,"context_line":"        ],"},{"line_number":357,"context_line":"        \"type\": \"string\""},{"line_number":358,"context_line":"    },"}],"source_content_type":"text/x-python","patch_set":65,"id":"06045c2d_e5b468a0","line":355,"range":{"start_line":355,"start_character":13,"end_line":355,"end_character":28},"in_reply_to":"d22aea3f_70695cdc","updated":"2024-06-26 15:31:37.000000000","message":"+1","commit_id":"3bbdd481aca0c17d0f7a1130b3fc2d9bda35e3e0"}],"glance/async_/flows/do_secure_hash.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"639b8f94_6956e225","line":1,"updated":"2023-06-23 14:33:33.000000000","message":"2023\n\nYou can rename this file as location_import","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2015 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"be21e196_ca928946","line":1,"in_reply_to":"639b8f94_6956e225","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":true,"context_lines":[{"line_number":37,"context_line":"class _NoHashCalculationSucceeded(exception.GlanceException):"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self, message):"},{"line_number":40,"context_line":"        super(_NoHashCalculationSucceeded, self).__init__(message)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class _CalculateHash(task.Task):"}],"source_content_type":"text/x-python","patch_set":1,"id":"d4958d21_6e6d6afa","line":40,"updated":"2023-06-22 14:07:19.000000000","message":"Replace with just `pass`? :)","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":true,"context_lines":[{"line_number":64,"context_line":"                    break"},{"line_number":65,"context_line":"                current_checksum.update(chunk)"},{"line_number":66,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":67,"context_line":"        except Exception:"},{"line_number":68,"context_line":"            msg \u003d (_(\u0027Hash calculation fails on image %s \u0027"},{"line_number":69,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":70,"context_line":"            self._retry_hash_calculation(image, hashing_algo, retry_limit)"}],"source_content_type":"text/x-python","patch_set":1,"id":"cab08129_ba14f014","line":67,"updated":"2023-06-22 14:07:19.000000000","message":"If we read half the image and the server closes the pipe, we should retry, IMHO.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                    break"},{"line_number":65,"context_line":"                current_checksum.update(chunk)"},{"line_number":66,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":67,"context_line":"        except Exception:"},{"line_number":68,"context_line":"            msg \u003d (_(\u0027Hash calculation fails on image %s \u0027"},{"line_number":69,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":70,"context_line":"            self._retry_hash_calculation(image, hashing_algo, retry_limit)"}],"source_content_type":"text/x-python","patch_set":1,"id":"87a2284f_6c0aed44","line":67,"in_reply_to":"cab08129_ba14f014","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":true,"context_lines":[{"line_number":65,"context_line":"                current_checksum.update(chunk)"},{"line_number":66,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":67,"context_line":"        except Exception:"},{"line_number":68,"context_line":"            msg \u003d (_(\u0027Hash calculation fails on image %s \u0027"},{"line_number":69,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":70,"context_line":"            self._retry_hash_calculation(image, hashing_algo, retry_limit)"},{"line_number":71,"context_line":"            raise _NoHashCalculationSucceeded(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"b0ef6010_f0538131","line":68,"range":{"start_line":68,"start_character":39,"end_line":68,"end_character":44},"updated":"2023-06-22 14:07:19.000000000","message":"\"failed\"","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"                current_checksum.update(chunk)"},{"line_number":66,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":67,"context_line":"        except Exception:"},{"line_number":68,"context_line":"            msg \u003d (_(\u0027Hash calculation fails on image %s \u0027"},{"line_number":69,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":70,"context_line":"            self._retry_hash_calculation(image, hashing_algo, retry_limit)"},{"line_number":71,"context_line":"            raise _NoHashCalculationSucceeded(msg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7e215ba7_0bf6a9f8","line":68,"range":{"start_line":68,"start_character":39,"end_line":68,"end_character":44},"in_reply_to":"b0ef6010_f0538131","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":91,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":92,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails\"\"\""},{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":94,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":95,"context_line":"        self.image_repo.save(image)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5d197134_a324cec9","line":94,"range":{"start_line":94,"start_character":0,"end_line":94,"end_character":44},"updated":"2023-06-23 14:33:33.000000000","message":"why not setting os_hash_value and checksum to None as well?\nimage state should be queued?","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":true,"context_lines":[{"line_number":91,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":92,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails\"\"\""},{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":94,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":95,"context_line":"        self.image_repo.save(image)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"2e3e8008_b9a8269a","line":94,"range":{"start_line":94,"start_character":0,"end_line":94,"end_character":44},"in_reply_to":"5d197134_a324cec9","updated":"2023-06-26 08:12:07.000000000","message":"if hash calculation fails, \u0027os_hash_value\u0027 \u0026 \u0027checksum\u0027 will not be set, those values are getting set after the successful calculation.\n\nNo, Image will remain in \u0027active\u0027 state as explained in the spec - scenario 2.\nIn this case, we need to set \u0027os_hash_algo\u0027 to None if hash calculation fails.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":true,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        for k, v in self.val_data.items():"},{"line_number":122,"context_line":"            if k !\u003d \u0027os_hash_algo\u0027 and v !\u003d getattr(image, k):"},{"line_number":123,"context_line":"                msg \u003d _(\"%s (%s) not matched with actual \""},{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"985f1563_b52ad66c","line":123,"range":{"start_line":123,"start_character":33,"end_line":123,"end_character":49},"updated":"2023-06-22 14:07:19.000000000","message":"\"does not match actual\"","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":120,"context_line":""},{"line_number":121,"context_line":"        for k, v in self.val_data.items():"},{"line_number":122,"context_line":"            if k !\u003d \u0027os_hash_algo\u0027 and v !\u003d getattr(image, k):"},{"line_number":123,"context_line":"                msg \u003d _(\"%s (%s) not matched with actual \""},{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":1,"id":"7abfe817_eb422095","line":123,"range":{"start_line":123,"start_character":33,"end_line":123,"end_character":49},"in_reply_to":"985f1563_b52ad66c","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"255e46e80abcc07dcc3d2a1ada9ffe27b81decbd","unresolved":true,"context_lines":[{"line_number":123,"context_line":"                msg \u003d _(\"%s (%s) not matched with actual \""},{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":127,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3918364e_0304bae3","line":126,"range":{"start_line":126,"start_character":22,"end_line":126,"end_character":63},"updated":"2023-06-22 14:07:19.000000000","message":"This isn\u0027t the right exception to raise in code that doesn\u0027t return to a client. I\u0027m guessing this was just copied over though.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                msg \u003d _(\"%s (%s) not matched with actual \""},{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":127,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"197b3411_4221c5bf","line":126,"range":{"start_line":126,"start_character":22,"end_line":126,"end_character":63},"in_reply_to":"3918364e_0304bae3","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":127,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":131,"context_line":"        \"\"\"Set image status back to queued\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"e6e735a0_718b7c5d","line":128,"range":{"start_line":127,"start_character":8,"end_line":128,"end_character":35},"updated":"2023-06-23 14:33:33.000000000","message":"You can move this to separate task","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"31500b33a1405175a145a206b9faead4fdb98669","unresolved":true,"context_lines":[{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":127,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":131,"context_line":"        \"\"\"Set image status back to queued\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"65eed55d_746a78fb","line":128,"range":{"start_line":127,"start_character":8,"end_line":128,"end_character":35},"in_reply_to":"86393f7c_00e8b01e","updated":"2023-06-29 18:32:23.000000000","message":"Not sure if this is still pending because I wrote some words on this, but it\u0027s not marked as resolved so let me try again.\n\nThis operation should, ideally, always be async regardless of how the server-side is configured. That means return 202 and do the work in the background to set the image active, regardless of what that work is. By moving this into the task itself, we\u0027ll get that behavior, even if the execution of that task is \"very fast.\"","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":true,"context_lines":[{"line_number":124,"context_line":"                        \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":125,"context_line":"                                      k, getattr(image, k))"},{"line_number":126,"context_line":"                raise webob.exc.HTTPBadRequest(explanation\u003dmsg)"},{"line_number":127,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":131,"context_line":"        \"\"\"Set image status back to queued\"\"\""}],"source_content_type":"text/x-python","patch_set":1,"id":"86393f7c_00e8b01e","line":128,"range":{"start_line":127,"start_character":8,"end_line":128,"end_character":35},"in_reply_to":"e6e735a0_718b7c5d","updated":"2023-06-26 08:12:07.000000000","message":"Didn\u0027t get this, why we need diff task for just updating the status to active?","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":197,"context_line":"    flow \u003d lf.Flow(task_type, retry\u003dretry.AlwaysRevert())"},{"line_number":198,"context_line":"    flow.add("},{"line_number":199,"context_line":"        _CalculateHash(task_id, task_type, image_repo, image_id))"},{"line_number":200,"context_line":"    if val_data:"},{"line_number":201,"context_line":"        flow.add("},{"line_number":202,"context_line":"            _ValidateValidationDataWithHash(task_id, task_type,"},{"line_number":203,"context_line":"                                            image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"cc6c262e_e8469172","line":200,"range":{"start_line":200,"start_character":7,"end_line":200,"end_character":15},"updated":"2023-06-23 14:33:33.000000000","message":"I think you need to consider do_secure_hash config option as well","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"31500b33a1405175a145a206b9faead4fdb98669","unresolved":true,"context_lines":[{"line_number":197,"context_line":"    flow \u003d lf.Flow(task_type, retry\u003dretry.AlwaysRevert())"},{"line_number":198,"context_line":"    flow.add("},{"line_number":199,"context_line":"        _CalculateHash(task_id, task_type, image_repo, image_id))"},{"line_number":200,"context_line":"    if val_data:"},{"line_number":201,"context_line":"        flow.add("},{"line_number":202,"context_line":"            _ValidateValidationDataWithHash(task_id, task_type,"},{"line_number":203,"context_line":"                                            image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"08246785_4b248ce4","line":200,"range":{"start_line":200,"start_character":7,"end_line":200,"end_character":15},"in_reply_to":"be4c84b8_36d1a0a5","updated":"2023-06-29 18:32:23.000000000","message":"If it\u0027s always async, then you can just do it all here, which will be better as well.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":true,"context_lines":[{"line_number":197,"context_line":"    flow \u003d lf.Flow(task_type, retry\u003dretry.AlwaysRevert())"},{"line_number":198,"context_line":"    flow.add("},{"line_number":199,"context_line":"        _CalculateHash(task_id, task_type, image_repo, image_id))"},{"line_number":200,"context_line":"    if val_data:"},{"line_number":201,"context_line":"        flow.add("},{"line_number":202,"context_line":"            _ValidateValidationDataWithHash(task_id, task_type,"},{"line_number":203,"context_line":"                                            image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"be4c84b8_36d1a0a5","line":200,"range":{"start_line":200,"start_character":7,"end_line":200,"end_character":15},"in_reply_to":"cc6c262e_e8469172","updated":"2023-06-26 08:12:07.000000000","message":"well, I\u0027m already checking this before starting the async task so is it necessary here?\n\nwhen we will finalize on whether update location would also be an async operation then we can consider this conf option here.","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":199,"context_line":"        _CalculateHash(task_id, task_type, image_repo, image_id))"},{"line_number":200,"context_line":"    if val_data:"},{"line_number":201,"context_line":"        flow.add("},{"line_number":202,"context_line":"            _ValidateValidationDataWithHash(task_id, task_type,"},{"line_number":203,"context_line":"                                            image_repo, image_id,"},{"line_number":204,"context_line":"                                            val_data))"},{"line_number":205,"context_line":"    flow.add("}],"source_content_type":"text/x-python","patch_set":1,"id":"d3da17d5_ce71c4bb","line":202,"range":{"start_line":202,"start_character":12,"end_line":202,"end_character":43},"updated":"2023-06-23 14:33:33.000000000","message":"Rename it as _VerifyValidationData","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":199,"context_line":"        _CalculateHash(task_id, task_type, image_repo, image_id))"},{"line_number":200,"context_line":"    if val_data:"},{"line_number":201,"context_line":"        flow.add("},{"line_number":202,"context_line":"            _ValidateValidationDataWithHash(task_id, task_type,"},{"line_number":203,"context_line":"                                            image_repo, image_id,"},{"line_number":204,"context_line":"                                            val_data))"},{"line_number":205,"context_line":"    flow.add("}],"source_content_type":"text/x-python","patch_set":1,"id":"060764e3_8da4e2c0","line":202,"range":{"start_line":202,"start_character":12,"end_line":202,"end_character":43},"in_reply_to":"d3da17d5_ce71c4bb","updated":"2023-06-26 08:12:07.000000000","message":"Ack","commit_id":"bd8f8b3b7f5c0e2e2e0b2cf79792fa6743fa263f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":83,"context_line":"        retry_limit \u003d 1"},{"line_number":84,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":85,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":86,"context_line":"        self._set_checksum_and_hash(image, retry_limit)"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        self.image_repo.save(image)"},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"33af2e1b_cc008f93","line":86,"range":{"start_line":86,"start_character":8,"end_line":86,"end_character":55},"updated":"2023-06-23 14:33:33.000000000","message":"I think calculation of hash and checksum should be different task and setting those values should be part of different tasks","commit_id":"c4714f499e3cf2d1cf482a1e0689037814682ef8"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ec05af4c4b0d2a71857053f38e14aa63d2854c2","unresolved":true,"context_lines":[{"line_number":134,"context_line":"        self.image_repo.save(image)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"class _CompleteTask(task.Task):"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def __init__(self, task_id, task_type, task_repo, image_id):"},{"line_number":140,"context_line":"        self.task_id \u003d task_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"7589e931_ff11c3c1","line":137,"range":{"start_line":137,"start_character":6,"end_line":137,"end_character":19},"updated":"2023-06-23 14:33:33.000000000","message":"I think rather duplicating the entire code, You can import this class from another module.","commit_id":"c4714f499e3cf2d1cf482a1e0689037814682ef8"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5208fdcf34d34b287f763357370190ecf68cf0d8","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        self.image_repo.save(image)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"class _CompleteTask(task.Task):"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"    def __init__(self, task_id, task_type, task_repo, image_id):"},{"line_number":140,"context_line":"        self.task_id \u003d task_id"}],"source_content_type":"text/x-python","patch_set":4,"id":"d450f78d_245dfc8b","line":137,"range":{"start_line":137,"start_character":6,"end_line":137,"end_character":19},"in_reply_to":"7589e931_ff11c3c1","updated":"2023-06-26 08:12:07.000000000","message":"Done","commit_id":"c4714f499e3cf2d1cf482a1e0689037814682ef8"}],"glance/async_/flows/location_import.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"58a61844c7e70ab4d4761ec31112b4545e03bc82","unresolved":true,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit):"},{"line_number":60,"context_line":"        while retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retry_limit)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"}],"source_content_type":"text/x-python","patch_set":8,"id":"b04810ef_0b193237","line":61,"updated":"2023-07-25 06:35:33.000000000","message":"Also debug log such as (\"retrying hash calculation %s\" % retry_limit) will help for debugging","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit):"},{"line_number":60,"context_line":"        while retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retry_limit)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"}],"source_content_type":"text/x-python","patch_set":8,"id":"73b9775a_0bf72f8c","line":61,"in_reply_to":"b04810ef_0b193237","updated":"2023-07-28 10:22:15.000000000","message":"Ack","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"58a61844c7e70ab4d4761ec31112b4545e03bc82","unresolved":true,"context_lines":[{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit):"},{"line_number":60,"context_line":"        while retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retry_limit)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3bf01598_2533b889","line":62,"range":{"start_line":62,"start_character":12,"end_line":62,"end_character":59},"updated":"2023-07-25 06:35:33.000000000","message":"Have you tested this retry operation in your environment?\n\nI think this loop needs to be break on successful retry otherwise it will call this function until the loop is over (for example if http_retries is set to 5 then this function will be called 5 times)\n\n\nA test to verify the same would be good to have!","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":true,"context_lines":[{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit):"},{"line_number":60,"context_line":"        while retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retry_limit)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"}],"source_content_type":"text/x-python","patch_set":8,"id":"46b71ff0_7e481ae2","line":62,"range":{"start_line":62,"start_character":12,"end_line":62,"end_character":59},"in_reply_to":"3bf01598_2533b889","updated":"2023-07-28 10:22:15.000000000","message":"Yes, tested it in my env only for retry on failures but not on if it succeeds in any of the retry. I will update this as you\u0027re suggesting.","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit):"},{"line_number":60,"context_line":"        while retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retry_limit)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"}],"source_content_type":"text/x-python","patch_set":8,"id":"9cc3b04b_00e30c90","line":62,"range":{"start_line":62,"start_character":12,"end_line":62,"end_character":59},"in_reply_to":"46b71ff0_7e481ae2","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"58a61844c7e70ab4d4761ec31112b4545e03bc82","unresolved":true,"context_lines":[{"line_number":71,"context_line":"                current_checksum.update(chunk)"},{"line_number":72,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":73,"context_line":"        except IOError:"},{"line_number":74,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":75,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":76,"context_line":"            self._retry_hash_calculation(image, retry_limit)"},{"line_number":77,"context_line":"            raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"c2fb3f6d_90f23844","line":74,"updated":"2023-07-25 06:35:33.000000000","message":"Similar log message here would help others to understand what has happened","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":71,"context_line":"                current_checksum.update(chunk)"},{"line_number":72,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":73,"context_line":"        except IOError:"},{"line_number":74,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":75,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":76,"context_line":"            self._retry_hash_calculation(image, retry_limit)"},{"line_number":77,"context_line":"            raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"6015a747_b237f352","line":74,"in_reply_to":"2ae0080e_de5303cf","updated":"2023-07-28 11:52:10.000000000","message":"Not sure what is the best practice, I will leave it for others core to suggest here.","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                current_checksum.update(chunk)"},{"line_number":72,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":73,"context_line":"        except IOError:"},{"line_number":74,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":75,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":76,"context_line":"            self._retry_hash_calculation(image, retry_limit)"},{"line_number":77,"context_line":"            raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"162ebb39_a1498b23","line":74,"in_reply_to":"6015a747_b237f352","updated":"2023-08-14 11:52:08.000000000","message":"Done","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":true,"context_lines":[{"line_number":71,"context_line":"                current_checksum.update(chunk)"},{"line_number":72,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":73,"context_line":"        except IOError:"},{"line_number":74,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":75,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":76,"context_line":"            self._retry_hash_calculation(image, retry_limit)"},{"line_number":77,"context_line":"            raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":8,"id":"2ae0080e_de5303cf","line":74,"in_reply_to":"c2fb3f6d_90f23844","updated":"2023-07-28 10:22:15.000000000","message":"Is it necessary to add separate log message here, because in the image_import task as well for such customize exceptions no separate log message has been added, https://github.com/openstack/glance/blob/46c30f0b6db6ed6a86b1b84e69748025ad9050c6/glance/async_/flows/api_image_import.py#L824","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"58a61844c7e70ab4d4761ec31112b4545e03bc82","unresolved":true,"context_lines":[{"line_number":131,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":132,"context_line":"        \"\"\"Set image status back to queued\"\"\""},{"line_number":133,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":134,"context_line":"        image.status \u003d \u0027queued\u0027"},{"line_number":135,"context_line":"        self.image_repo.save(image)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"90bf8b8e_45465a50","line":134,"updated":"2023-07-25 06:35:33.000000000","message":"Shouldn\u0027t we reset values of os_hash* and checksum to None?","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":131,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":132,"context_line":"        \"\"\"Set image status back to queued\"\"\""},{"line_number":133,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":134,"context_line":"        image.status \u003d \u0027queued\u0027"},{"line_number":135,"context_line":"        self.image_repo.save(image)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"33506b90_6f317e3d","line":134,"in_reply_to":"6fae2f56_62bd9e3d","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":true,"context_lines":[{"line_number":131,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":132,"context_line":"        \"\"\"Set image status back to queued\"\"\""},{"line_number":133,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":134,"context_line":"        image.status \u003d \u0027queued\u0027"},{"line_number":135,"context_line":"        self.image_repo.save(image)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"6fae2f56_62bd9e3d","line":134,"in_reply_to":"90bf8b8e_45465a50","updated":"2023-07-28 10:22:15.000000000","message":"yeah right, I will update this.","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"58a61844c7e70ab4d4761ec31112b4545e03bc82","unresolved":true,"context_lines":[{"line_number":167,"context_line":"            image.locations.append(updated_location)"},{"line_number":168,"context_line":"            self.image_repo.save(image)"},{"line_number":169,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":170,"context_line":"            raise _InvalidLocation(e.msg)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"class _SetImageToActiveTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":8,"id":"b8cc0a88_963c2ef3","line":170,"updated":"2023-07-25 06:35:33.000000000","message":"Log message would be helpful here","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ebfab4a525529b4db57303bf1f30f761709b964c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            image.locations.append(updated_location)"},{"line_number":168,"context_line":"            self.image_repo.save(image)"},{"line_number":169,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":170,"context_line":"            raise _InvalidLocation(e.msg)"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"class _SetImageToActiveTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ecdcaa66_842377c7","line":170,"in_reply_to":"b8cc0a88_963c2ef3","updated":"2023-07-28 10:22:15.000000000","message":"Ack","commit_id":"a4280c1b35366fd3cf3490694596198eac4e5c3b"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":57,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"856114da_58343e70","line":60,"range":{"start_line":60,"start_character":18,"end_line":60,"end_character":30},"updated":"2023-07-31 11:49:14.000000000","message":"nit: call_succeeded ?","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"d4ba321f_a8657efd","line":60,"range":{"start_line":60,"start_character":18,"end_line":60,"end_character":30},"in_reply_to":"688b979c_3583632a","updated":"2023-08-03 05:46:05.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":true,"context_lines":[{"line_number":57,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"688b979c_3583632a","line":60,"range":{"start_line":60,"start_character":18,"end_line":60,"end_character":30},"in_reply_to":"856114da_58343e70","updated":"2023-08-02 13:07:02.000000000","message":"parameter not needed now.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"c861baba_03f906af","line":61,"range":{"start_line":61,"start_character":12,"end_line":61,"end_character":23},"updated":"2023-07-31 11:49:14.000000000","message":"nit: retries","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f23156b_9afbf003","line":61,"range":{"start_line":61,"start_character":12,"end_line":61,"end_character":23},"in_reply_to":"c861baba_03f906af","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"}],"source_content_type":"text/x-python","patch_set":9,"id":"938a13df_a6827ebe","line":62,"updated":"2023-07-28 11:52:10.000000000","message":"You are initializing it to 1 at line #93, and increasing it here, so for 1st try it will log like,\n\nRetrying hash calculation 2\n\nwhich is misleading.\n\nAlso change the debug message to;\n\n\"Attempt \u0027%s\u0027 for hash calculation retry\" or something more meaningful.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _retry_hash_calculation(self, image, retry_limit, cal_suceeded):"},{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"}],"source_content_type":"text/x-python","patch_set":9,"id":"03ed3e66_05d4e705","line":62,"in_reply_to":"938a13df_a6827ebe","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":66,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9deb8464_bc20557f","line":63,"updated":"2023-07-28 11:52:10.000000000","message":"I think introducing flag to break the loop will lead to more possibilities of failure, you can check if image has \u0027checksum\u0027 or \u0027os_hash_value\u0027 attribute set to other than None to avoid this.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        while not cal_suceeded and retry_limit \u003c CONF.http_retries:"},{"line_number":61,"context_line":"            retry_limit +\u003d 1"},{"line_number":62,"context_line":"            LOG.debug(\"Retrying hash calculation %s\", retry_limit)"},{"line_number":63,"context_line":"            cal_suceeded \u003d self._set_checksum_and_hash(image, retry_limit)"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":66,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"}],"source_content_type":"text/x-python","patch_set":9,"id":"b5c2e2e8_866e0e54","line":63,"in_reply_to":"9deb8464_bc20557f","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":66,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"},{"line_number":67,"context_line":"        current_checksum \u003d md5(usedforsecurity\u003dFalse)"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            for chunk in image.get_data():"},{"line_number":70,"context_line":"                if chunk is None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"2cdeb260_f79d2946","line":67,"range":{"start_line":67,"start_character":27,"end_line":67,"end_character":30},"updated":"2023-07-31 11:49:14.000000000","message":"the better way to do this is import modules and not direct methods\nOne example where this could be wrong in a large codebase is, we won\u0027t know if this md5 method is from haslib or from oslo_utils.secretutils\n\nfollowing seems to be the best way to do it\n\n    from oslo_utils import secretutils\n    secretutils.md5(usedforsecurity\u003dFalse)","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _set_checksum_and_hash(self, image, retry_limit):"},{"line_number":66,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"},{"line_number":67,"context_line":"        current_checksum \u003d md5(usedforsecurity\u003dFalse)"},{"line_number":68,"context_line":"        try:"},{"line_number":69,"context_line":"            for chunk in image.get_data():"},{"line_number":70,"context_line":"                if chunk is None:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4a51dc_8672a7f5","line":67,"range":{"start_line":67,"start_character":27,"end_line":67,"end_character":30},"in_reply_to":"2cdeb260_f79d2946","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":77,"context_line":"            self._retry_hash_calculation(image, retry_limit,"},{"line_number":78,"context_line":"                                         cal_suceeded\u003dFalse)"},{"line_number":79,"context_line":"            LOG.debug(\u0027Hash calculation failed on image %s \u0027"},{"line_number":80,"context_line":"                      \u0027data\u0027, self.image_id)"},{"line_number":81,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":82,"context_line":"        cal_suceeded \u003d True"},{"line_number":83,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"}],"source_content_type":"text/x-python","patch_set":9,"id":"af1d8188_6df5193c","line":80,"updated":"2023-07-28 11:52:10.000000000","message":"I think you need to use _( here?\n\nAlso you can add more meaningful message here like,\n\nHash calculation failed for image after retrying \u0027%s\u0027 times % CONF.http_retries","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            self._retry_hash_calculation(image, retry_limit,"},{"line_number":78,"context_line":"                                         cal_suceeded\u003dFalse)"},{"line_number":79,"context_line":"            LOG.debug(\u0027Hash calculation failed on image %s \u0027"},{"line_number":80,"context_line":"                      \u0027data\u0027, self.image_id)"},{"line_number":81,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":82,"context_line":"        cal_suceeded \u003d True"},{"line_number":83,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"}],"source_content_type":"text/x-python","patch_set":9,"id":"c06c8150_83fc2523","line":80,"in_reply_to":"af1d8188_6df5193c","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        :param image_id: Glance Image ID"},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        retry_limit \u003d 1"},{"line_number":94,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":95,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":96,"context_line":"        self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"338460e6_5c47ea9c","line":93,"updated":"2023-07-28 11:52:10.000000000","message":"Can you have a look at Times class of taskflow package, so that you can avoid writing custom retry logic?\n\nhttps://github.com/openstack/taskflow/blob/master/taskflow/retry.py#L247\n\nI think this will be more secure to use (if possible).","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8b97cda28372892a2ff951fb890928cd50e96b7f","unresolved":true,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        :param image_id: Glance Image ID"},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        retry_limit \u003d 1"},{"line_number":94,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":95,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":96,"context_line":"        self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"a3bc9596_0e26a016","line":93,"in_reply_to":"338460e6_5c47ea9c","updated":"2023-07-28 11:59:19.000000000","message":"Ignore this, as this will lead to retry entire flow and not particular task.\nI think if we decided to use this mechanism then it will require additional changes.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"1e718b3500c0bb8a34966f2db6c9ed8637187766","unresolved":false,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        :param image_id: Glance Image ID"},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        retry_limit \u003d 1"},{"line_number":94,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":95,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":96,"context_line":"        self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"364c6345_b96f67d9","line":93,"in_reply_to":"60c15358_37153f76","updated":"2023-10-31 09:32:41.000000000","message":"Ack","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a93ca8ae47a7221f91aa64362424b3742c9984f3","unresolved":true,"context_lines":[{"line_number":90,"context_line":""},{"line_number":91,"context_line":"        :param image_id: Glance Image ID"},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":"        retry_limit \u003d 1"},{"line_number":94,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":95,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":96,"context_line":"        self._set_checksum_and_hash(image, retry_limit)"}],"source_content_type":"text/x-python","patch_set":9,"id":"60c15358_37153f76","line":93,"in_reply_to":"a3bc9596_0e26a016","updated":"2023-07-28 12:51:57.000000000","message":"If you decide to have it a go, then you can refer my example here.\n\nhttps://paste.opendev.org/show/bjkuxBhtjZ9KjCgFZnUb/","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"36c7246915c1775a39dccef4f1d05e7c4c314805","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"8480f588_435bb74c","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"updated":"2023-07-28 13:09:25.000000000","message":"Is there any chance of race here?\nFor example, do_secure_hash is True, hash calculation is in progress (For large data) so before coming here to this task image state is queued, so is it possible for other user to upload the data to that image using glance image-upload image-id --file or any other API(if that is public/community/ or visible to other users?)\n\n@dan any guess?","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e8c415e9bffbadad0fc22ccbb6c7d57957c08e8e","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"f12ba72d_c3922527","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"in_reply_to":"734cc764_832ba6fb","updated":"2023-07-31 13:37:00.000000000","message":"Agree that we should be in importing state while calculating, but that doesn\u0027t solve the atomicity concern Abhi had. We have to take some sort of locking action before the API call returns to prevent a second action from taking place on a single image. Tasks can be delayed in execution.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"53320679ff0124b0166b35d68f9cd38198e423f0","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"d6d4f180_7e55777d","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"in_reply_to":"734cc764_832ba6fb","updated":"2023-08-01 12:48:06.000000000","message":"ohh yes, status should set to importing while calculating the hash, I will update that.\n@dan, I will add the lock to the image similar to image import in next updated ps.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"32f45672e91e09e301c5e86ea91d154d4806b1c0","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"e451a0b2_9dc3051b","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"in_reply_to":"8480f588_435bb74c","updated":"2023-07-28 13:45:56.000000000","message":"This was a hole in import before, which I plugged, I think during the distributed import work:\n\nhttps://github.com/openstack/glance/blob/master/glance/api/v2/images.py#L470-L478\n\nSo, the location add API needs to do the same thing as import. That means this is still okay, but only if the API patch gets changed. Good spot ;)\n\nFor reference, Nova handles this by setting the \"intended\" state in the API, which prevents any other actions from starting after the first, and then sets the \"actual state\" once it is complete.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"1d572efa_8df96d1f","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"in_reply_to":"d6d4f180_7e55777d","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":123,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":124,"context_line":"        \"\"\""},{"line_number":125,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":126,"context_line":"        image.status \u003d \u0027importing\u0027"},{"line_number":127,"context_line":"        self.image_repo.save(image)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":9,"id":"734cc764_832ba6fb","line":126,"range":{"start_line":126,"start_character":8,"end_line":126,"end_character":34},"in_reply_to":"e451a0b2_9dc3051b","updated":"2023-07-31 11:49:14.000000000","message":"Maybe I\u0027m missing something but the transition seems wrong here. While doing the hash calculation, the image status should be importing.\nWe have 2 cases here:\n1) No validation data is provided\nthe initial state is \u0027queued\u0027, we set the image to \u0027active\u0027 state and do the hash calculation in background\n2) validation data is provided\nthe initial state is \u0027queued\u0027, we set the image to \u0027importing\u0027 state and start the hash calculation\nOnce the hash calculation finishes, we change the state from \u0027importing\u0027 to \u0027active\u0027","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":163,"context_line":"        \"\"\""},{"line_number":164,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":165,"context_line":"        try:"},{"line_number":166,"context_line":"            # (NOTE(pdeore): Add metadata key to add the store identifire"},{"line_number":167,"context_line":"            # as location metadata"},{"line_number":168,"context_line":"            updated_location \u003d {"},{"line_number":169,"context_line":"                \u0027url\u0027: self.url,"}],"source_content_type":"text/x-python","patch_set":9,"id":"631f5d49_2ebf7471","line":166,"range":{"start_line":166,"start_character":63,"end_line":166,"end_character":73},"updated":"2023-07-31 11:49:14.000000000","message":"nit: identifier","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        \"\"\""},{"line_number":164,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":165,"context_line":"        try:"},{"line_number":166,"context_line":"            # (NOTE(pdeore): Add metadata key to add the store identifire"},{"line_number":167,"context_line":"            # as location metadata"},{"line_number":168,"context_line":"            updated_location \u003d {"},{"line_number":169,"context_line":"                \u0027url\u0027: self.url,"}],"source_content_type":"text/x-python","patch_set":9,"id":"2966c21b_47060ebb","line":166,"range":{"start_line":166,"start_character":63,"end_line":166,"end_character":73},"in_reply_to":"631f5d49_2ebf7471","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":173,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":174,"context_line":"                    [updated_location])[0]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"            image.locations.append(updated_location)"},{"line_number":177,"context_line":"            self.image_repo.save(image)"},{"line_number":178,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":179,"context_line":"            raise _InvalidLocation(e.msg)"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"696da22a_5e9c2b8a","line":177,"range":{"start_line":176,"start_character":12,"end_line":177,"end_character":39},"updated":"2023-07-31 11:49:14.000000000","message":"don\u0027t we require a revert here to remove the locations if any of these calls fail?","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":174,"context_line":"                    [updated_location])[0]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"            image.locations.append(updated_location)"},{"line_number":177,"context_line":"            self.image_repo.save(image)"},{"line_number":178,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":179,"context_line":"            raise _InvalidLocation(e.msg)"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5d3f32f1_ee2cb78b","line":177,"range":{"start_line":176,"start_character":12,"end_line":177,"end_character":39},"in_reply_to":"09d3ba55_9377cd71","updated":"2023-08-03 05:46:05.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":true,"context_lines":[{"line_number":173,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":174,"context_line":"                    [updated_location])[0]"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"            image.locations.append(updated_location)"},{"line_number":177,"context_line":"            self.image_repo.save(image)"},{"line_number":178,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":179,"context_line":"            raise _InvalidLocation(e.msg)"},{"line_number":180,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"09d3ba55_9377cd71","line":177,"range":{"start_line":176,"start_character":12,"end_line":177,"end_character":39},"in_reply_to":"696da22a_5e9c2b8a","updated":"2023-08-02 13:07:02.000000000","message":"I think we don\u0027t need revert here since no location would be added if this task fails, instead now removing the location in revert of hash calculation \u0026 verification of validation data.","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"667468af47fb2aad54ef16715f3396a5a0e2536d","unresolved":true,"context_lines":[{"line_number":250,"context_line":"                               hashing_algo))"},{"line_number":251,"context_line":"    else:"},{"line_number":252,"context_line":"        flow.add("},{"line_number":253,"context_line":"            _SetImageToActiveTask(task_id, task_type, image_repo, image_id))"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    flow.add("},{"line_number":256,"context_line":"        image_import._CompleteTask(task_id, task_type, task_repo,"}],"source_content_type":"text/x-python","patch_set":9,"id":"275b0a40_7b509f74","line":253,"updated":"2023-07-28 11:52:10.000000000","message":"I might be missing something here, but if do_secure_hash is False and if user passed checksum and hash_value along with hash_algo then we need to set it right?\n\nhttps://review.opendev.org/c/openstack/glance-specs/+/883491/8/specs/2023.2/approved/glance/new-location-info-apis.rst#144","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"3cab820d24454c848d31631e8671f63b93f81f5d","unresolved":false,"context_lines":[{"line_number":250,"context_line":"                               hashing_algo))"},{"line_number":251,"context_line":"    else:"},{"line_number":252,"context_line":"        flow.add("},{"line_number":253,"context_line":"            _SetImageToActiveTask(task_id, task_type, image_repo, image_id))"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    flow.add("},{"line_number":256,"context_line":"        image_import._CompleteTask(task_id, task_type, task_repo,"}],"source_content_type":"text/x-python","patch_set":9,"id":"cc479a5b_e8a4cfcb","line":253,"in_reply_to":"0983e531_d3a61f34","updated":"2023-08-02 13:07:02.000000000","message":"Done","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9c2edd5c67b5c85543330809e5327f13d10cf5a1","unresolved":true,"context_lines":[{"line_number":250,"context_line":"                               hashing_algo))"},{"line_number":251,"context_line":"    else:"},{"line_number":252,"context_line":"        flow.add("},{"line_number":253,"context_line":"            _SetImageToActiveTask(task_id, task_type, image_repo, image_id))"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    flow.add("},{"line_number":256,"context_line":"        image_import._CompleteTask(task_id, task_type, task_repo,"}],"source_content_type":"text/x-python","patch_set":9,"id":"c7958bbe_fa40acdf","line":253,"in_reply_to":"275b0a40_7b509f74","updated":"2023-07-31 11:49:14.000000000","message":"+1, we do need to set the validation data in the image properties even when we aren\u0027t calculating the hash","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"53320679ff0124b0166b35d68f9cd38198e423f0","unresolved":true,"context_lines":[{"line_number":250,"context_line":"                               hashing_algo))"},{"line_number":251,"context_line":"    else:"},{"line_number":252,"context_line":"        flow.add("},{"line_number":253,"context_line":"            _SetImageToActiveTask(task_id, task_type, image_repo, image_id))"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"    flow.add("},{"line_number":256,"context_line":"        image_import._CompleteTask(task_id, task_type, task_repo,"}],"source_content_type":"text/x-python","patch_set":9,"id":"0983e531_d3a61f34","line":253,"in_reply_to":"c7958bbe_fa40acdf","updated":"2023-08-01 12:48:06.000000000","message":"actually i was setting those properties in sync part [1], but it should have been here in the task itself. I will update that as well in next ps.\n\n[1]: https://review.opendev.org/c/openstack/glance/+/881940/23/glance/api/v2/images.py#1187","commit_id":"d6d4810429f02f669a700d5eaa0d44c3a64be8f3"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e4d64579bb5bd0b0f6c639adb922117f58baf45e","unresolved":true,"context_lines":[{"line_number":62,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":63,"context_line":"            retries +\u003d 1"},{"line_number":64,"context_line":"            LOG.debug(\"Attempt \u0027%s\u0027 for hash calculation retry\","},{"line_number":65,"context_line":"                      retries)"},{"line_number":66,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _set_checksum_and_hash(self, image, retries):"}],"source_content_type":"text/x-python","patch_set":10,"id":"7223c8b8_1843fcb3","line":65,"updated":"2023-08-02 14:46:48.000000000","message":"It will log 2 on first retry here.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[{"line_number":62,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":63,"context_line":"            retries +\u003d 1"},{"line_number":64,"context_line":"            LOG.debug(\"Attempt \u0027%s\u0027 for hash calculation retry\","},{"line_number":65,"context_line":"                      retries)"},{"line_number":66,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _set_checksum_and_hash(self, image, retries):"}],"source_content_type":"text/x-python","patch_set":10,"id":"99dfdd6f_9f5fc5ee","line":65,"in_reply_to":"7223c8b8_1843fcb3","updated":"2023-08-03 05:46:05.000000000","message":"Done","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e4d64579bb5bd0b0f6c639adb922117f58baf45e","unresolved":true,"context_lines":[{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027%s times\u0027), CONF.http_retries)"},{"line_number":83,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":84,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":85,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":10,"id":"3574e728_d8040a8b","line":82,"range":{"start_line":82,"start_character":37,"end_line":82,"end_character":54},"updated":"2023-08-02 14:46:48.000000000","message":"you can use retries here","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027%s times\u0027), CONF.http_retries)"},{"line_number":83,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":84,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":85,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":10,"id":"96a8e459_b289d1d9","line":82,"range":{"start_line":82,"start_character":37,"end_line":82,"end_character":54},"in_reply_to":"3574e728_d8040a8b","updated":"2023-08-03 05:46:05.000000000","message":"Done","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e4d64579bb5bd0b0f6c639adb922117f58baf45e","unresolved":true,"context_lines":[{"line_number":102,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":103,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":104,"context_line":"        if image.locations:"},{"line_number":105,"context_line":"            image.locations.pop()"},{"line_number":106,"context_line":"        self.image_repo.save(image)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"1436addd_92840e47","line":105,"updated":"2023-08-02 14:46:48.000000000","message":"Why not reverting checksum and os_hash_value here as well?","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":103,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":104,"context_line":"        if image.locations:"},{"line_number":105,"context_line":"            image.locations.pop()"},{"line_number":106,"context_line":"        self.image_repo.save(image)"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"39b5e50d_8901f3b8","line":105,"in_reply_to":"1436addd_92840e47","updated":"2023-08-03 05:46:05.000000000","message":"If hash calculation fails those values will not be set, and in verify validation task I\u0027m reverting those to None.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e4d64579bb5bd0b0f6c639adb922117f58baf45e","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3902bd86_1c7d70dd","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"updated":"2023-08-02 14:46:48.000000000","message":"I think this is not needed because in previous task you are already setting those, right?","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6a259947ac1ccafac5b0041ac7119cdc00eec05c","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"8bc46bb3_621434b2","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"in_reply_to":"3902bd86_1c7d70dd","updated":"2023-08-03 05:46:05.000000000","message":"which previous task? this part will be executed when do_secure_hash is false and validation data is not None.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c9603870c20fbd6e3d5d0f845a0569a43c25e251","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"af8171bd_231c0482","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"in_reply_to":"6d5e17e4_a30a497a","updated":"2023-08-09 11:15:00.000000000","message":"Done","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d93acc5c803f4663334e34a45ee2e4e4a72fee95","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"bc841dbc_9c620c32","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"in_reply_to":"8bc46bb3_621434b2","updated":"2023-08-03 06:09:05.000000000","message":"The code has two much conditioning, i think you should create separate tasks based on scenarios rather than dividing one task to do many things based on conditions in it.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"bd29b69ea581bdf8a57298895dd0f94330b98d36","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"c014a6bd_6fe6f078","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"in_reply_to":"bc841dbc_9c620c32","updated":"2023-08-03 08:50:32.000000000","message":"I think this is the only task (VerifyValidationData) which has more conditions, others are quite straightforward.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"74ae19ddfe5f4474518b0653b2577c7e293686e5","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                    raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":136,"context_line":"                                                          extra_msg\u003dmsg)"},{"line_number":137,"context_line":"            else:"},{"line_number":138,"context_line":"                setattr(image, k, v)"},{"line_number":139,"context_line":"        self.image_repo.save(image)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":10,"id":"6d5e17e4_a30a497a","line":138,"range":{"start_line":138,"start_character":15,"end_line":138,"end_character":36},"in_reply_to":"c014a6bd_6fe6f078","updated":"2023-08-03 09:29:52.000000000","message":"Yes and you can restructure it so that the code where you are building this taskflow will also have less conditions.\n\nOne example is you are setting attributes in verifyvalidationdata task which does not need to do verification if do_secure_hash is false.","commit_id":"b34aa3ade7f9152a735c5d0ecb8d2144ee6931d2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"be12e5f0df1adcceeb8c36ef82f1c3f2eb2e923a","unresolved":true,"context_lines":[{"line_number":148,"context_line":"        self.image_repo.save(image)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"class _SetValidationDataValues(task.Task):"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def __init__(self, task_id, task_type, image_repo, image_id,"},{"line_number":154,"context_line":"                 val_data):"}],"source_content_type":"text/x-python","patch_set":12,"id":"503eeff8_71a146d9","line":151,"range":{"start_line":151,"start_character":6,"end_line":151,"end_character":30},"updated":"2023-08-04 07:11:34.000000000","message":"You can rename it to _SetHashValues or _SetHashData","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c9603870c20fbd6e3d5d0f845a0569a43c25e251","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        self.image_repo.save(image)"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"class _SetValidationDataValues(task.Task):"},{"line_number":152,"context_line":""},{"line_number":153,"context_line":"    def __init__(self, task_id, task_type, image_repo, image_id,"},{"line_number":154,"context_line":"                 val_data):"}],"source_content_type":"text/x-python","patch_set":12,"id":"04a9d9d6_dc5a1c2e","line":151,"range":{"start_line":151,"start_character":6,"end_line":151,"end_character":30},"in_reply_to":"503eeff8_71a146d9","updated":"2023-08-09 11:15:00.000000000","message":"Done","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"be12e5f0df1adcceeb8c36ef82f1c3f2eb2e923a","unresolved":true,"context_lines":[{"line_number":171,"context_line":"        for k, v in self.val_data.items():"},{"line_number":172,"context_line":"            setattr(image, k, v)"},{"line_number":173,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":174,"context_line":"        self.image_repo.save(image)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":12,"id":"f2a0e3e5_5d38d593","line":174,"updated":"2023-08-04 07:11:34.000000000","message":"There is a possibility of failure here while saving the image, so we should have a revert to unset values as well.","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c9603870c20fbd6e3d5d0f845a0569a43c25e251","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        for k, v in self.val_data.items():"},{"line_number":172,"context_line":"            setattr(image, k, v)"},{"line_number":173,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":174,"context_line":"        self.image_repo.save(image)"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":12,"id":"68bbf752_e9e401f5","line":174,"in_reply_to":"f2a0e3e5_5d38d593","updated":"2023-08-09 11:15:00.000000000","message":"Done","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"670a84de9af39251a80d11b43977d517a4c04e66","unresolved":true,"context_lines":[{"line_number":203,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":204,"context_line":"                    [updated_location])[0]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            image.locations.append(updated_location)"},{"line_number":207,"context_line":"            self.image_repo.save(image)"},{"line_number":208,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":209,"context_line":"            raise _InvalidLocation(e.msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"d2d6789e_7f4c7ba3","line":206,"range":{"start_line":206,"start_character":12,"end_line":206,"end_character":51},"updated":"2023-08-07 13:31:35.000000000","message":"while testing from cinder side, I\u0027m facing the following error here\n\n\u003e /opt/stack/glance/glance/async_/flows/location_import.py(207)execute()\n-\u003e image.locations.append(updated_location)\n(Pdb) \nglance.common.exception.BadStoreUri: Invalid location\n\nI tried with 2 different URL formats,\n\n1) \u0027cinder://989759da-4af8-40db-9606-e52126c5b21b\u0027\n2) \u0027cinder://lvmdriver-1/989759da-4af8-40db-9606-e52126c5b21b\u0027\n\nboth error out with same error\n\nOne strange thing i noted is that image.locations point to a quota object?\n\n(Pdb) image.locations\n\u003cglance.quota.QuotaImageLocationsProxy object at 0x7fec10d6ba60\u003e\n\nwhereas image.locations.locations point to the location object\n\n(Pdb) image.locations.locations\n\u003cglance.location.StoreLocations object at 0x7fec10de44f0\u003e","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"1494c2f92b17ece8eb33df02629fc467ffa5648d","unresolved":false,"context_lines":[{"line_number":203,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":204,"context_line":"                    [updated_location])[0]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            image.locations.append(updated_location)"},{"line_number":207,"context_line":"            self.image_repo.save(image)"},{"line_number":208,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":209,"context_line":"            raise _InvalidLocation(e.msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"bb184a4b_95d91bf9","line":206,"range":{"start_line":206,"start_character":12,"end_line":206,"end_character":51},"in_reply_to":"59cd0935_0e0e6e36","updated":"2023-08-09 11:32:06.000000000","message":"Done","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"14d3983d3f8e57c4e0ea0b8c68e3fb93e121cfb2","unresolved":true,"context_lines":[{"line_number":203,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":204,"context_line":"                    [updated_location])[0]"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"            image.locations.append(updated_location)"},{"line_number":207,"context_line":"            self.image_repo.save(image)"},{"line_number":208,"context_line":"        except (exception.Invalid, exception.BadStoreUri) as e:"},{"line_number":209,"context_line":"            raise _InvalidLocation(e.msg)"}],"source_content_type":"text/x-python","patch_set":12,"id":"59cd0935_0e0e6e36","line":206,"range":{"start_line":206,"start_character":12,"end_line":206,"end_character":51},"in_reply_to":"d2d6789e_7f4c7ba3","updated":"2023-08-09 09:53:47.000000000","message":"This needs additional changes for cinder location url;\nhttps://paste.opendev.org/show/bpa9TyuOVNF1rMGQSPVZ/\n\nThe reason is cinder sends location url as cinder://volume_id for single as well as multistore, we at glance side need to modify that location url to be compatible with multistore as cinder://store_id/volume_id to avoid Invalid Location error from cinder side \n\n\nIn your case it was also failing with cinder://id or cinder://store_id/id because \n\n1. if you are testing it with single store (with cinder://id as loc url) then it was failing to fetch volume from cinder and raising NotFound which later converted to Invalid Location [1] or with cinder://store/id with Badstore as it is a single store setup.\n\n2. If you configured multistore and testing it with cinder://id as url then it will fail with BadStore which is correct but with cinder://store/id it fails with volume not found at cinder which later converted to Invalid Location [1]\n\nIn order to fix the volume not found error at cinder you need to set additional parameter at cinder side which I updated in commit message.\n\nimage_upload_use_internal_tenant \u003d True\n\n[1] https://github.com/openstack/glance/blob/master/glance/location.py#L133\n\n\nI think we need to fix [1] to include exception message as well so that it will help developer to know the actual failure reason rather that just saying or logging Invalid Location.","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"be12e5f0df1adcceeb8c36ef82f1c3f2eb2e923a","unresolved":true,"context_lines":[{"line_number":278,"context_line":"                                      image_id))"},{"line_number":279,"context_line":"            flow.add("},{"line_number":280,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":281,"context_line":"                               hashing_algo, val_data\u003dNone))"},{"line_number":282,"context_line":"    elif val_data:"},{"line_number":283,"context_line":"        flow.add("},{"line_number":284,"context_line":"            _SetValidationDataValues(task_id, task_type, image_repo,"}],"source_content_type":"text/x-python","patch_set":12,"id":"ad458f1c_eaf693f7","line":281,"range":{"start_line":281,"start_character":45,"end_line":281,"end_character":58},"updated":"2023-08-04 07:11:34.000000000","message":"this is not required","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c9603870c20fbd6e3d5d0f845a0569a43c25e251","unresolved":false,"context_lines":[{"line_number":278,"context_line":"                                      image_id))"},{"line_number":279,"context_line":"            flow.add("},{"line_number":280,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":281,"context_line":"                               hashing_algo, val_data\u003dNone))"},{"line_number":282,"context_line":"    elif val_data:"},{"line_number":283,"context_line":"        flow.add("},{"line_number":284,"context_line":"            _SetValidationDataValues(task_id, task_type, image_repo,"}],"source_content_type":"text/x-python","patch_set":12,"id":"8c9480b5_ebc2422d","line":281,"range":{"start_line":281,"start_character":45,"end_line":281,"end_character":58},"in_reply_to":"ad458f1c_eaf693f7","updated":"2023-08-09 11:15:00.000000000","message":"Done","commit_id":"c1190d0d0a4cb53764000d1a04197e4d12f3f078"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8105f237e5cf91b4695d8cf8897058436cc05829","unresolved":true,"context_lines":[{"line_number":90,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":91,"context_line":"        if self.val_data:"},{"line_number":92,"context_line":"            image.status \u003d \u0027importing\u0027"},{"line_number":93,"context_line":"            self.image_repo.save(image)"},{"line_number":94,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":14,"id":"5e884d2e_47692ea4","line":93,"updated":"2023-08-09 17:23:26.000000000","message":"I think this save call is not required, save call at line 96 is enough.","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a324bd4a4e97ac4d2b343a8d1715d5ccfda15e9d","unresolved":true,"context_lines":[{"line_number":90,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":91,"context_line":"        if self.val_data:"},{"line_number":92,"context_line":"            image.status \u003d \u0027importing\u0027"},{"line_number":93,"context_line":"            self.image_repo.save(image)"},{"line_number":94,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":14,"id":"c2596929_bec3913b","line":93,"in_reply_to":"5e884d2e_47692ea4","updated":"2023-08-10 05:18:03.000000000","message":"ignore this comment","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66554061eb6cd208b4e98d53f05bbd1aaf730f31","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":91,"context_line":"        if self.val_data:"},{"line_number":92,"context_line":"            image.status \u003d \u0027importing\u0027"},{"line_number":93,"context_line":"            self.image_repo.save(image)"},{"line_number":94,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"        self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":14,"id":"cd39b67c_99413ae6","line":93,"in_reply_to":"c2596929_bec3913b","updated":"2023-08-10 05:35:51.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8105f237e5cf91b4695d8cf8897058436cc05829","unresolved":true,"context_lines":[{"line_number":133,"context_line":"                                       k, getattr(image, k)))"},{"line_number":134,"context_line":"                raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":135,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":136,"context_line":"        self.image_repo.save(image)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":139,"context_line":"        \"\"\"Set image status back to queued\"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"ce4b7d34_d7428449","line":136,"range":{"start_line":136,"start_character":8,"end_line":136,"end_character":35},"updated":"2023-08-09 17:23:26.000000000","message":"We are not setting anything here so this save call is also not necessary.","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                                       k, getattr(image, k)))"},{"line_number":134,"context_line":"                raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":135,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":136,"context_line":"        self.image_repo.save(image)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":139,"context_line":"        \"\"\"Set image status back to queued\"\"\""}],"source_content_type":"text/x-python","patch_set":14,"id":"d7931f6b_dd81d597","line":136,"range":{"start_line":136,"start_character":8,"end_line":136,"end_character":35},"in_reply_to":"ce4b7d34_d7428449","updated":"2023-08-14 11:52:08.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8105f237e5cf91b4695d8cf8897058436cc05829","unresolved":true,"context_lines":[{"line_number":179,"context_line":"        if image.os_hash_algo:"},{"line_number":180,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9dccf77d_a8c23eb5","line":182,"updated":"2023-08-09 17:23:26.000000000","message":"If i am not wrong then we need to reset checksum to None and image.state to queued as well.\n\nTo avoid setting image active in this task you can remove line no 173 and instead can add \u0027_SetImageToActiveTask\u0027 after line #296 \n\nAlso this needs self.image_repo.save(image) call otherwise these changes will not be saved in the database.\n\nI think this requires unit/functional test to verify this scenario as well.","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        if image.os_hash_algo:"},{"line_number":180,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":14,"id":"da434b84_fa43108c","line":182,"in_reply_to":"9dccf77d_a8c23eb5","updated":"2023-08-14 11:52:08.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"46abf1c450e364ca649f93ea476c3a3a1b6529bc","unresolved":false,"context_lines":[{"line_number":179,"context_line":"        if image.os_hash_algo:"},{"line_number":180,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7e9683ca_44a18a75","line":182,"in_reply_to":"da434b84_fa43108c","updated":"2023-08-14 14:53:45.000000000","message":"Can","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def execute(self):"},{"line_number":163,"context_line":"        \"\"\"Set user provided hash algo and value hash properties to image"},{"line_number":164,"context_line":"           when do_secure_hash is False and set image to \u0027active\u0027."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        :param image_id: Glance Image ID"},{"line_number":167,"context_line":"        :val_data: Validation Data provider by user"}],"source_content_type":"text/x-python","patch_set":15,"id":"326f4d49_fad69c8c","line":164,"range":{"start_line":164,"start_character":39,"end_line":164,"end_character":64},"updated":"2023-08-21 05:58:09.000000000","message":"This should be removed now.","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a63ddc0d4d9b03669b51e18e7db8cab903508fe8","unresolved":false,"context_lines":[{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def execute(self):"},{"line_number":163,"context_line":"        \"\"\"Set user provided hash algo and value hash properties to image"},{"line_number":164,"context_line":"           when do_secure_hash is False and set image to \u0027active\u0027."},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"        :param image_id: Glance Image ID"},{"line_number":167,"context_line":"        :val_data: Validation Data provider by user"}],"source_content_type":"text/x-python","patch_set":15,"id":"4f275d61_50a7aa16","line":164,"range":{"start_line":164,"start_character":39,"end_line":164,"end_character":64},"in_reply_to":"326f4d49_fad69c8c","updated":"2023-08-24 13:48:59.000000000","message":"Done","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"46abf1c450e364ca649f93ea476c3a3a1b6529bc","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":184,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":185,"context_line":"        self.image_repo.save(image)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"c7a1595d_52220121","line":184,"range":{"start_line":184,"start_character":0,"end_line":184,"end_character":35},"updated":"2023-08-14 14:53:45.000000000","message":"Can you point the test unit and functional covering this scenario?","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"1e718b3500c0bb8a34966f2db6c9ed8637187766","unresolved":false,"context_lines":[{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":184,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":185,"context_line":"        self.image_repo.save(image)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"66c4b8cd_6f22a58c","line":184,"range":{"start_line":184,"start_character":0,"end_line":184,"end_character":35},"in_reply_to":"2fa75c6e_93fa29c4","updated":"2023-10-31 09:32:41.000000000","message":"I\u0027ve tried to handle this in functional test by mocking the save call and raising the error, but it doesn\u0027t fails as expected and image remains in active state only.","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":184,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":185,"context_line":"        self.image_repo.save(image)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"2fa75c6e_93fa29c4","line":184,"range":{"start_line":184,"start_character":0,"end_line":184,"end_character":35},"in_reply_to":"9ed5bbc4_ef9eb054","updated":"2023-08-21 05:58:09.000000000","message":"I think you are using waiting mechanism to check image reaches to expected state,right? I think you can enhance that method to raise an exception.","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"132f0b03cd4efd504b8489c06596101063fb48f9","unresolved":true,"context_lines":[{"line_number":181,"context_line":"        if image.os_hash_value:"},{"line_number":182,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":183,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":184,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":185,"context_line":"        self.image_repo.save(image)"},{"line_number":186,"context_line":""},{"line_number":187,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"9ed5bbc4_ef9eb054","line":184,"range":{"start_line":184,"start_character":0,"end_line":184,"end_character":35},"in_reply_to":"c7a1595d_52220121","updated":"2023-08-16 09:30:42.000000000","message":"I\u0027ve added unit tests for this now, [1] but not sure how to handle this kind of failure scenario in functional tests, I mean this revert method will be called\nonly when there would be failure while updating the image i.e., image will never reach to active state in that case. I will try to add that test later may be once the client, sdk, doc part is done which is on high priority atm. \n\n[1]: https://review.opendev.org/c/openstack/glance/+/881940/29/glance/tests/unit/async_/flows/test_location_import.py#280","commit_id":"ae4a9a4aa715049d8f1af45134b41e97de52b836"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":true,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":16,"id":"f5bdf9d1_3e3dbd1e","line":1,"range":{"start_line":1,"start_character":27,"end_line":1,"end_character":37},"updated":"2023-08-17 14:31:27.000000000","message":"I think this should be \"Red Hat, Inc\" :)","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"bae595a4d6c0f6b2b4d240b2773cdb3e1850bbf4","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":16,"id":"b0973e79_2f210f05","line":1,"range":{"start_line":1,"start_character":27,"end_line":1,"end_character":37},"in_reply_to":"f5bdf9d1_3e3dbd1e","updated":"2023-08-20 12:19:26.000000000","message":"Done","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":true,"context_lines":[{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027%s times\u0027), retries)"},{"line_number":83,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":84,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":85,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"57a8e37d_bab4d3b1","line":83,"range":{"start_line":83,"start_character":44,"end_line":83,"end_character":45},"updated":"2023-08-17 14:31:27.000000000","message":"I think we always run LOG.debug() and raise the _HashCalculationFailed exception here, even if self._retry_hash_caclulcation() is successful.\n\nCould we get a test that throws an IOError and see how the exception handling code behaves?","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"215017affc6ffe50d797a8f0bc2e3caec9c7f7c1","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027%s times\u0027), retries)"},{"line_number":83,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":84,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":85,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"147d3053_64c823a2","line":83,"range":{"start_line":83,"start_character":44,"end_line":83,"end_character":45},"in_reply_to":"0f9c5e4b_83556a44","updated":"2023-08-25 17:42:04.000000000","message":"Done","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"bae595a4d6c0f6b2b4d240b2773cdb3e1850bbf4","unresolved":true,"context_lines":[{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027%s times\u0027), retries)"},{"line_number":83,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":84,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":85,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"0f9c5e4b_83556a44","line":83,"range":{"start_line":83,"start_character":44,"end_line":83,"end_character":45},"in_reply_to":"57a8e37d_bab4d3b1","updated":"2023-08-20 12:19:26.000000000","message":"I have added the unit test to check this, ex. it will call LOG.debug \u0026 _HashCalculationFailed once after the first retry is successful \u0026 exited from the retry method.","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":true,"context_lines":[{"line_number":96,"context_line":"        self.image_repo.save(image)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":99,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails\"\"\""},{"line_number":100,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":101,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":102,"context_line":"        if image.status !\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":16,"id":"428aa390_d62cb789","line":99,"range":{"start_line":99,"start_character":46,"end_line":99,"end_character":57},"updated":"2023-08-17 14:31:27.000000000","message":"This method does a little more than that, right?","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"bae595a4d6c0f6b2b4d240b2773cdb3e1850bbf4","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        self.image_repo.save(image)"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":99,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails\"\"\""},{"line_number":100,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":101,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":102,"context_line":"        if image.status !\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":16,"id":"8d2fc7bc_823bf651","line":99,"range":{"start_line":99,"start_character":46,"end_line":99,"end_character":57},"in_reply_to":"428aa390_d62cb789","updated":"2023-08-20 12:19:26.000000000","message":"Done","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":true,"context_lines":[{"line_number":135,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":138,"context_line":"        \"\"\"Set image status back to queued\"\"\""},{"line_number":139,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":140,"context_line":"        if image.locations:"},{"line_number":141,"context_line":"            image.locations.pop()"}],"source_content_type":"text/x-python","patch_set":16,"id":"195f7952_3a5babd9","line":138,"range":{"start_line":138,"start_character":36,"end_line":138,"end_character":42},"updated":"2023-08-17 14:31:27.000000000","message":"We should have more details about what this method does, or remove the docstring completely.","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"bae595a4d6c0f6b2b4d240b2773cdb3e1850bbf4","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":138,"context_line":"        \"\"\"Set image status back to queued\"\"\""},{"line_number":139,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":140,"context_line":"        if image.locations:"},{"line_number":141,"context_line":"            image.locations.pop()"}],"source_content_type":"text/x-python","patch_set":16,"id":"44907c3c_5a814ced","line":138,"range":{"start_line":138,"start_character":36,"end_line":138,"end_character":42},"in_reply_to":"195f7952_3a5babd9","updated":"2023-08-20 12:19:26.000000000","message":"Done","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":61,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":62,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":63,"context_line":"            retries +\u003d 1"},{"line_number":64,"context_line":"            LOG.debug(\"Attempt \u0027%s\u0027 for hash calculation retry\","},{"line_number":65,"context_line":"                      retries)"},{"line_number":66,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"23e7c99b_e008a858","line":64,"range":{"start_line":64,"start_character":23,"end_line":64,"end_character":63},"updated":"2023-08-21 05:58:09.000000000","message":"nit: Retry no \u0027%s\u0027 for hash and checksum calculation","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":61,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":62,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":63,"context_line":"            retries +\u003d 1"},{"line_number":64,"context_line":"            LOG.debug(\"Attempt \u0027%s\u0027 for hash calculation retry\","},{"line_number":65,"context_line":"                      retries)"},{"line_number":66,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"0b7f9b1a_6c93c742","line":64,"range":{"start_line":64,"start_character":23,"end_line":64,"end_character":63},"in_reply_to":"23e7c99b_e008a858","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":74,"context_line":"                    break"},{"line_number":75,"context_line":"                current_checksum.update(chunk)"},{"line_number":76,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":77,"context_line":"        except IOError:"},{"line_number":78,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"}],"source_content_type":"text/x-python","patch_set":17,"id":"d882ba1f_fb73206c","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":23},"updated":"2023-08-21 05:58:09.000000000","message":"I think you can also attach original exception message below so that developer/user can understand the cause of failure.","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                    break"},{"line_number":75,"context_line":"                current_checksum.update(chunk)"},{"line_number":76,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":77,"context_line":"        except IOError:"},{"line_number":78,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"}],"source_content_type":"text/x-python","patch_set":17,"id":"006ec30e_860bd789","line":77,"range":{"start_line":77,"start_character":8,"end_line":77,"end_character":23},"in_reply_to":"d882ba1f_fb73206c","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":76,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":77,"context_line":"        except IOError:"},{"line_number":78,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"}],"source_content_type":"text/x-python","patch_set":17,"id":"3d1f4aa0_3e98bc76","line":79,"updated":"2023-08-21 05:58:09.000000000","message":"I think you can log the failure message here as debug.","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":77,"context_line":"        except IOError:"},{"line_number":78,"context_line":"            msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":79,"context_line":"                     \u0027data\u0027) % self.image_id)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"}],"source_content_type":"text/x-python","patch_set":17,"id":"cd3d8ba0_272f64f6","line":79,"in_reply_to":"3d1f4aa0_3e98bc76","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ad3d92abf4fbf6d88ec66f6cb73950ca19315b96","unresolved":true,"context_lines":[{"line_number":134,"context_line":"                msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":135,"context_line":"                         \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":136,"context_line":"                                       k, getattr(image, k)))"},{"line_number":137,"context_line":"                raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":138,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":17,"id":"4df6f3d2_c806eb95","line":137,"range":{"start_line":137,"start_character":0,"end_line":137,"end_character":71},"updated":"2023-08-21 06:03:26.000000000","message":"Where is this caught?","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":135,"context_line":"                         \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":136,"context_line":"                                       k, getattr(image, k)))"},{"line_number":137,"context_line":"                raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":138,"context_line":"                                                      extra_msg\u003dmsg)"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":17,"id":"d84651a5_aa446f05","line":137,"range":{"start_line":137,"start_character":0,"end_line":137,"end_character":71},"in_reply_to":"4df6f3d2_c806eb95","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":169,"context_line":"           when do_secure_hash is False."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        :param image_id: Glance Image ID"},{"line_number":172,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":175,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":17,"id":"1476a674_2d7b09dd","line":172,"range":{"start_line":172,"start_character":35,"end_line":172,"end_character":43},"updated":"2023-08-21 05:58:09.000000000","message":"provided","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":169,"context_line":"           when do_secure_hash is False."},{"line_number":170,"context_line":""},{"line_number":171,"context_line":"        :param image_id: Glance Image ID"},{"line_number":172,"context_line":"        :val_data: Validation Data provider by user"},{"line_number":173,"context_line":"        \"\"\""},{"line_number":174,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":175,"context_line":"        for k, v in self.val_data.items():"}],"source_content_type":"text/x-python","patch_set":17,"id":"c1142a04_a87f7a6d","line":172,"range":{"start_line":172,"start_character":35,"end_line":172,"end_character":43},"in_reply_to":"1476a674_2d7b09dd","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":248,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":249,"context_line":"        self.image_repo.save(image)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":17,"id":"317c30ba_3bf669ab","line":249,"updated":"2023-08-21 05:58:09.000000000","message":"I think this task should also have a revert method since save operation might fail.","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        \"\"\""},{"line_number":247,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":248,"context_line":"        image.status \u003d \u0027active\u0027"},{"line_number":249,"context_line":"        self.image_repo.save(image)"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":""},{"line_number":252,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":17,"id":"9fb05838_8c869e8a","line":249,"in_reply_to":"317c30ba_3bf669ab","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a63ddc0d4d9b03669b51e18e7db8cab903508fe8","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(msg)"},{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"},{"line_number":86,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":88,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":18,"id":"718dfbfd_dbfa395d","line":85,"range":{"start_line":85,"start_character":55,"end_line":85,"end_character":67},"updated":"2023-08-24 13:48:59.000000000","message":"why +1 here?\n\nI think if conf value is set to 3 then it will show retried 4 times if I am not wrong.","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"b701d8125d26818985d73fad22f9b3013b01236f","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(msg)"},{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"},{"line_number":86,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":88,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":18,"id":"97cb0bc9_6834cc94","line":85,"range":{"start_line":85,"start_character":55,"end_line":85,"end_character":67},"in_reply_to":"718dfbfd_dbfa395d","updated":"2023-08-25 11:28:53.000000000","message":"+1 because \u0027retries\u0027 is initialize to 0 and after first retry the \u0027retry times\u0027 will be logged with retries+1. this will logged 3 times if retry called 3 time so after last retry \u0027retries\u0027 will be set to 2 and in log it will be 3.","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"86a52c134800b3d987d7beb0ba6f47892c622c14","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(msg)"},{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"},{"line_number":86,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":88,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":18,"id":"cbe789e6_d3e4d5f8","line":85,"range":{"start_line":85,"start_character":55,"end_line":85,"end_character":67},"in_reply_to":"7ab72e5d_da018be2","updated":"2023-08-28 08:45:33.000000000","message":"Ack","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2d7f60603c8ddb593ce72409f2d002b17a192585","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(msg)"},{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"},{"line_number":86,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":88,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":18,"id":"f4e147d1_288745a5","line":85,"range":{"start_line":85,"start_character":55,"end_line":85,"end_character":67},"in_reply_to":"97cb0bc9_6834cc94","updated":"2023-08-25 12:48:26.000000000","message":"and what about you increasing it at line 65?\ni still think it will log as 4, could you please add a test to verify the log messgae?","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"215017affc6ffe50d797a8f0bc2e3caec9c7f7c1","unresolved":true,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(msg)"},{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries + 1})"},{"line_number":86,"context_line":"            raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"        image.checksum \u003d current_checksum.hexdigest()"},{"line_number":88,"context_line":"        image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":18,"id":"7ab72e5d_da018be2","line":85,"range":{"start_line":85,"start_character":55,"end_line":85,"end_character":67},"in_reply_to":"f4e147d1_288745a5","updated":"2023-08-25 17:42:04.000000000","message":"Yeah right, it logs as 4. Removed +1 and tried to add a test for it [1].\n\n[1]: https://review.opendev.org/c/openstack/glance/+/881940/33/glance/tests/unit/async_/flows/test_location_import.py#120","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a63ddc0d4d9b03669b51e18e7db8cab903508fe8","unresolved":true,"context_lines":[{"line_number":262,"context_line":"        if image.locations:"},{"line_number":263,"context_line":"            image.locations.pop()"},{"line_number":264,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":265,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":266,"context_line":"        self.image_repo.save(image)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"a2862d07_9894bd83","line":265,"updated":"2023-08-24 13:48:59.000000000","message":"what about setting properties to None?\nos_hash_* and checksum","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"115bc3825209f0ada1b063bfd458385f9f812918","unresolved":false,"context_lines":[{"line_number":262,"context_line":"        if image.locations:"},{"line_number":263,"context_line":"            image.locations.pop()"},{"line_number":264,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":265,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":266,"context_line":"        self.image_repo.save(image)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"a61f53ad_96a748e8","line":265,"in_reply_to":"66f59c3a_e289b753","updated":"2023-08-28 05:49:32.000000000","message":"Ack","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"b701d8125d26818985d73fad22f9b3013b01236f","unresolved":true,"context_lines":[{"line_number":262,"context_line":"        if image.locations:"},{"line_number":263,"context_line":"            image.locations.pop()"},{"line_number":264,"context_line":"        if image.status !\u003d \u0027queued\u0027:"},{"line_number":265,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":266,"context_line":"        self.image_repo.save(image)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"66f59c3a_e289b753","line":265,"in_reply_to":"a2862d07_9894bd83","updated":"2023-08-25 11:28:53.000000000","message":"That\u0027s not required because whichever tasks executed before SetImageToActiveTask, their revert methods would also be called and these properties will be reverted to None if set.","commit_id":"7070bd51c571717f5c2dcff85d9d399ad2cb59cd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"90263ef29ae8776069aad30e5aa26ae60f67ff95","unresolved":true,"context_lines":[{"line_number":56,"context_line":"        self.image_repo \u003d image_repo"},{"line_number":57,"context_line":"        self.image_id \u003d image_id"},{"line_number":58,"context_line":"        self.hashing_algo \u003d hashing_algo"},{"line_number":59,"context_line":"        self.val_data \u003d val_data"},{"line_number":60,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":61,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"324068a4_cc1c1cbe","line":59,"range":{"start_line":59,"start_character":0,"end_line":59,"end_character":6},"updated":"2023-08-28 06:08:19.000000000","message":"I think this is not required and so does its related test in https://review.opendev.org/c/openstack/glance/+/881940/34/glance/tests/unit/async_/flows/test_location_import.py#62","commit_id":"c72a63437cac3800fdffb8d5769c44bc661ff5c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c00ca384043eeb43671b606558844d77cbde9e4a","unresolved":true,"context_lines":[{"line_number":56,"context_line":"        self.image_repo \u003d image_repo"},{"line_number":57,"context_line":"        self.image_id \u003d image_id"},{"line_number":58,"context_line":"        self.hashing_algo \u003d hashing_algo"},{"line_number":59,"context_line":"        self.val_data \u003d val_data"},{"line_number":60,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":61,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"cc032b69_7ae8fc1c","line":59,"range":{"start_line":59,"start_character":0,"end_line":59,"end_character":6},"in_reply_to":"324068a4_cc1c1cbe","updated":"2023-08-28 08:39:45.000000000","message":"that was added for setting image status to \u0027importing\u0027 when val_data is available. \nReplacing it with image status now.","commit_id":"c72a63437cac3800fdffb8d5769c44bc661ff5c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"2efc4bfbb48a8ba6b3727189e9a5bf99007a8269","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.image_repo \u003d image_repo"},{"line_number":57,"context_line":"        self.image_id \u003d image_id"},{"line_number":58,"context_line":"        self.hashing_algo \u003d hashing_algo"},{"line_number":59,"context_line":"        self.val_data \u003d val_data"},{"line_number":60,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":61,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"c2e7ed27_7d02f141","line":59,"range":{"start_line":59,"start_character":0,"end_line":59,"end_character":6},"in_reply_to":"cc032b69_7ae8fc1c","updated":"2023-09-20 08:42:12.000000000","message":"Done","commit_id":"c72a63437cac3800fdffb8d5769c44bc661ff5c7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"f639726a9762a8d00e0c927937351b41642fa760","unresolved":true,"context_lines":[{"line_number":309,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":310,"context_line":"                                      image_id))"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            flow.add("},{"line_number":313,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":314,"context_line":"                                      image_id))"},{"line_number":315,"context_line":"            flow.add("},{"line_number":316,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":317,"context_line":"                               hashing_algo))"},{"line_number":318,"context_line":"    elif val_data:"},{"line_number":319,"context_line":"        flow.add("},{"line_number":320,"context_line":"            _SetHashValues(task_id, task_type, image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"d6908b8e_d1f756e1","line":317,"range":{"start_line":312,"start_character":12,"end_line":317,"end_character":45},"updated":"2023-08-28 09:43:05.000000000","message":"Do we have a functional test for this failure scenario?\nScenario,\nimage is set to active\nhash calculation fails\nand image is set back to queued?","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"cd90230bf37d9720a50ec6a4e7d78685385937d6","unresolved":true,"context_lines":[{"line_number":309,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":310,"context_line":"                                      image_id))"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            flow.add("},{"line_number":313,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":314,"context_line":"                                      image_id))"},{"line_number":315,"context_line":"            flow.add("},{"line_number":316,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":317,"context_line":"                               hashing_algo))"},{"line_number":318,"context_line":"    elif val_data:"},{"line_number":319,"context_line":"        flow.add("},{"line_number":320,"context_line":"            _SetHashValues(task_id, task_type, image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"4405553b_7a91b179","line":317,"range":{"start_line":312,"start_character":12,"end_line":317,"end_character":45},"in_reply_to":"039ec802_7c0fb0c9","updated":"2023-08-28 10:00:10.000000000","message":"Also in spec, we are not talking about rolling back to queued state if hash calculation fails\n\nhttps://review.opendev.org/c/openstack/glance-specs/+/883491/8/specs/2023.2/approved/glance/new-location-info-apis.rst#110","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c40e29f994e330fd34ebb249973292c7f16519de","unresolved":true,"context_lines":[{"line_number":309,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":310,"context_line":"                                      image_id))"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            flow.add("},{"line_number":313,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":314,"context_line":"                                      image_id))"},{"line_number":315,"context_line":"            flow.add("},{"line_number":316,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":317,"context_line":"                               hashing_algo))"},{"line_number":318,"context_line":"    elif val_data:"},{"line_number":319,"context_line":"        flow.add("},{"line_number":320,"context_line":"            _SetHashValues(task_id, task_type, image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"a591d8ee_34cc1a78","line":317,"range":{"start_line":312,"start_character":12,"end_line":317,"end_character":45},"in_reply_to":"4405553b_7a91b179","updated":"2023-08-28 12:29:04.000000000","message":"My bad, I completely missed that! Updated it now.","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"71ddf9e8cc45a6e631986398cc19c1d550869efe","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":310,"context_line":"                                      image_id))"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            flow.add("},{"line_number":313,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":314,"context_line":"                                      image_id))"},{"line_number":315,"context_line":"            flow.add("},{"line_number":316,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":317,"context_line":"                               hashing_algo))"},{"line_number":318,"context_line":"    elif val_data:"},{"line_number":319,"context_line":"        flow.add("},{"line_number":320,"context_line":"            _SetHashValues(task_id, task_type, image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"bb9bf8f5_921060cf","line":317,"range":{"start_line":312,"start_character":12,"end_line":317,"end_character":45},"in_reply_to":"a591d8ee_34cc1a78","updated":"2023-08-29 18:41:12.000000000","message":"Done","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ef2f79dc0a79c32d4dc04afe8e9ccdf50a5c5181","unresolved":true,"context_lines":[{"line_number":309,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":310,"context_line":"                                      image_id))"},{"line_number":311,"context_line":"        else:"},{"line_number":312,"context_line":"            flow.add("},{"line_number":313,"context_line":"                _SetImageToActiveTask(task_id, task_type, image_repo,"},{"line_number":314,"context_line":"                                      image_id))"},{"line_number":315,"context_line":"            flow.add("},{"line_number":316,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":317,"context_line":"                               hashing_algo))"},{"line_number":318,"context_line":"    elif val_data:"},{"line_number":319,"context_line":"        flow.add("},{"line_number":320,"context_line":"            _SetHashValues(task_id, task_type, image_repo, image_id,"}],"source_content_type":"text/x-python","patch_set":20,"id":"039ec802_7c0fb0c9","line":317,"range":{"start_line":312,"start_character":12,"end_line":317,"end_character":45},"in_reply_to":"d6908b8e_d1f756e1","updated":"2023-08-28 09:50:19.000000000","message":"I don\u0027t think so we have it or either it is tested locally since image transition from active to queued is restricted in glance [1].\n\nFrom active only transition is allowed is deleted, pending_delete or deactivated.\nI think we should ignore the hash calculation failure if validation data is not provided and just log a warning message and let image be in active state.\n\nSo in rollback we need to check if image.state is not in [active, queued]\nrollback it to queued state.\n\n[1] https://github.com/openstack/glance/blob/master/glance/domain/__init__.py#L110","commit_id":"330166ff29d0d218265f8a539d1118560e73a11f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"90e2a169062775d3785807f252935927d4c31dbf","unresolved":true,"context_lines":[{"line_number":56,"context_line":"        self.image_repo \u003d image_repo"},{"line_number":57,"context_line":"        self.image_id \u003d image_id"},{"line_number":58,"context_line":"        self.hashing_algo \u003d hashing_algo"},{"line_number":59,"context_line":"        self.val_data \u003d val_data"},{"line_number":60,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":61,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"cbabaaa9_3762bb10","line":59,"updated":"2023-08-28 16:18:25.000000000","message":"as i commented in PS 19, does not make sense to pass entire validation data for just setting image state, instead passing desired image state as input makes more sense.\n\nIn test (unit) also you are setting importing state by yourself so the test I pointed in above comment and another test is just checking what we are passing to task as input and not actual functionality.\n\nI also doesn\u0027t see any functional test which asserts image state is changed to importing or reverted to queued from importing (point me if I missed that test)","commit_id":"cac6316d866e82f7ff85b9770090de015b659f63"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"1e718b3500c0bb8a34966f2db6c9ed8637187766","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.image_repo \u003d image_repo"},{"line_number":57,"context_line":"        self.image_id \u003d image_id"},{"line_number":58,"context_line":"        self.hashing_algo \u003d hashing_algo"},{"line_number":59,"context_line":"        self.val_data \u003d val_data"},{"line_number":60,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":61,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"5792715e_22f3dd90","line":59,"in_reply_to":"cbabaaa9_3762bb10","updated":"2023-10-31 09:32:41.000000000","message":"Done","commit_id":"cac6316d866e82f7ff85b9770090de015b659f63"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"90e2a169062775d3785807f252935927d4c31dbf","unresolved":true,"context_lines":[{"line_number":77,"context_line":"                current_checksum.update(chunk)"},{"line_number":78,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":79,"context_line":"        except IOError as e:"},{"line_number":80,"context_line":"            if self.val_data:"},{"line_number":81,"context_line":"                msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":82,"context_line":"                       {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":83,"context_line":"                LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":21,"id":"a030536e_bcd01dcc","line":80,"updated":"2023-08-28 16:18:25.000000000","message":"This is wrong, we need to retry hash calculation failure by IOError even if validation data is not passed as input","commit_id":"cac6316d866e82f7ff85b9770090de015b659f63"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"2efc4bfbb48a8ba6b3727189e9a5bf99007a8269","unresolved":false,"context_lines":[{"line_number":77,"context_line":"                current_checksum.update(chunk)"},{"line_number":78,"context_line":"                current_os_hash_value.update(chunk)"},{"line_number":79,"context_line":"        except IOError as e:"},{"line_number":80,"context_line":"            if self.val_data:"},{"line_number":81,"context_line":"                msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":82,"context_line":"                       {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":83,"context_line":"                LOG.debug(msg)"}],"source_content_type":"text/x-python","patch_set":21,"id":"3994b6e5_682f73e4","line":80,"in_reply_to":"a030536e_bcd01dcc","updated":"2023-09-20 08:42:12.000000000","message":"Done","commit_id":"cac6316d866e82f7ff85b9770090de015b659f63"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"624a63986288922c28ed000be91ed6470a849e1e","unresolved":true,"context_lines":[{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"},{"line_number":86,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":87,"context_line":"                raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            else:"},{"line_number":89,"context_line":"                LOG.warning(\"Hash calculation failed for image %s\","},{"line_number":90,"context_line":"                            self.image_id)"},{"line_number":91,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"}],"source_content_type":"text/x-python","patch_set":22,"id":"d4307550_2fdb08c6","line":92,"range":{"start_line":86,"start_character":12,"end_line":92,"end_character":43},"updated":"2023-08-29 09:50:05.000000000","message":"Also you can avoid this and let this task continue successful even hash calculation fails.\n\nIn case of val_data it will got to next task and fail as these properties will not be set, you just need to catch AttributeError there at line 150.\n\nIn case of no val_data even if os_hash_algo is set and not checksum or os_hash_value admin can know that hash calculation failed for the image. Also we have mentioned something about polling on os_hash_algo in consumers or clients in spec which will break if we remove it from here.","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"28eb6fd35502e7c8a393a66cbb9e65fd007301e4","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":84,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":85,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"},{"line_number":86,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":87,"context_line":"                raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            else:"},{"line_number":89,"context_line":"                LOG.warning(\"Hash calculation failed for image %s\","},{"line_number":90,"context_line":"                            self.image_id)"},{"line_number":91,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"}],"source_content_type":"text/x-python","patch_set":22,"id":"88984b8e_4ccbf691","line":92,"range":{"start_line":86,"start_character":12,"end_line":92,"end_character":43},"in_reply_to":"d4307550_2fdb08c6","updated":"2023-08-29 14:21:20.000000000","message":"Done","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"624a63986288922c28ed000be91ed6470a849e1e","unresolved":true,"context_lines":[{"line_number":90,"context_line":"                            self.image_id)"},{"line_number":91,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"},{"line_number":96,"context_line":"            image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":22,"id":"be074025_71400da0","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":20},"updated":"2023-08-29 09:50:05.000000000","message":"This is not required.","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"28eb6fd35502e7c8a393a66cbb9e65fd007301e4","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                            self.image_id)"},{"line_number":91,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"},{"line_number":96,"context_line":"            image.os_hash_value \u003d current_os_hash_value.hexdigest()"}],"source_content_type":"text/x-python","patch_set":22,"id":"0ce927c3_420843b4","line":93,"range":{"start_line":93,"start_character":16,"end_line":93,"end_character":20},"in_reply_to":"be074025_71400da0","updated":"2023-08-29 14:21:20.000000000","message":"Done","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"624a63986288922c28ed000be91ed6470a849e1e","unresolved":true,"context_lines":[{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"},{"line_number":96,"context_line":"            image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def execute(self):"},{"line_number":99,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":22,"id":"6c43efec_9025315b","line":96,"range":{"start_line":95,"start_character":12,"end_line":96,"end_character":67},"updated":"2023-08-29 09:50:05.000000000","message":"you can move this inside except block after line no 78","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"28eb6fd35502e7c8a393a66cbb9e65fd007301e4","unresolved":false,"context_lines":[{"line_number":92,"context_line":"                self.image_repo.save(image)"},{"line_number":93,"context_line":"                pass"},{"line_number":94,"context_line":"        else:"},{"line_number":95,"context_line":"            image.checksum \u003d current_checksum.hexdigest()"},{"line_number":96,"context_line":"            image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    def execute(self):"},{"line_number":99,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":22,"id":"33a8c178_6e12a49c","line":96,"range":{"start_line":95,"start_character":12,"end_line":96,"end_character":67},"in_reply_to":"6c43efec_9025315b","updated":"2023-08-29 14:21:20.000000000","message":"Done","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"624a63986288922c28ed000be91ed6470a849e1e","unresolved":true,"context_lines":[{"line_number":146,"context_line":"                    msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":147,"context_line":"                             \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":148,"context_line":"                                           k, getattr(image, k)))"},{"line_number":149,"context_line":"                    raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":150,"context_line":"        except webob.exc.HTTPConflict:"},{"line_number":151,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":152,"context_line":"                                                  extra_msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":22,"id":"6dd50767_4c1f47a5","line":149,"range":{"start_line":149,"start_character":0,"end_line":149,"end_character":13},"updated":"2023-08-29 09:50:05.000000000","message":"sync this is async flow raising webob.exc.* doesn\u0027t make sense as it will not be returned to user, you can raise normal exception defined in exception module of glance.","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"28eb6fd35502e7c8a393a66cbb9e65fd007301e4","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                    msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":147,"context_line":"                             \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":148,"context_line":"                                           k, getattr(image, k)))"},{"line_number":149,"context_line":"                    raise webob.exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":150,"context_line":"        except webob.exc.HTTPConflict:"},{"line_number":151,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":152,"context_line":"                                                  extra_msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":22,"id":"6bbbd3b5_cef6ee6e","line":149,"range":{"start_line":149,"start_character":0,"end_line":149,"end_character":13},"in_reply_to":"6dd50767_4c1f47a5","updated":"2023-08-29 14:21:20.000000000","message":"Done","commit_id":"0bba1d1ece5938d9a3f3f81e8b31652bc5f8c35b"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"a005aa5860e977455c8d4e42c00cb1dd87aac4ae","unresolved":true,"context_lines":[{"line_number":136,"context_line":"                    msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":137,"context_line":"                             \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":138,"context_line":"                                           k, getattr(image, k)))"},{"line_number":139,"context_line":"                    raise AttributeError(msg)"},{"line_number":140,"context_line":"        except AttributeError:"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":23,"id":"8c6b18e5_7967008b","line":139,"range":{"start_line":139,"start_character":26,"end_line":139,"end_character":40},"updated":"2023-08-29 16:55:43.000000000","message":"This does not sound like AttributeError, earlier custom error raised was correct here, what I said in previous comment is you should caught AttributeError at line 140 (I failed to mentioned catch AttributeError as well)","commit_id":"e59335a69ccf8e0311467b706247873f4a6af9fc"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"71ddf9e8cc45a6e631986398cc19c1d550869efe","unresolved":false,"context_lines":[{"line_number":136,"context_line":"                    msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":137,"context_line":"                             \"%s (%s)\") % (k, self.val_data[k],"},{"line_number":138,"context_line":"                                           k, getattr(image, k)))"},{"line_number":139,"context_line":"                    raise AttributeError(msg)"},{"line_number":140,"context_line":"        except AttributeError:"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":23,"id":"dba3fb2c_28602ee5","line":139,"range":{"start_line":139,"start_character":26,"end_line":139,"end_character":40},"in_reply_to":"8c6b18e5_7967008b","updated":"2023-08-29 18:41:12.000000000","message":"Done","commit_id":"e59335a69ccf8e0311467b706247873f4a6af9fc"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3867328eb1ed2b5c9b4b720c7d565487f27a7bc0","unresolved":true,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class _HashCalculationFailed(exception.GlanceException):"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self, message):"},{"line_number":40,"context_line":"        super(_HashCalculationFailed, self).__init__(message)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class _InvalidLocation(exception.GlanceException):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def __init__(self, message):"}],"source_content_type":"text/x-python","patch_set":24,"id":"2a48f05f_91392d24","line":42,"range":{"start_line":36,"start_character":0,"end_line":42,"end_character":0},"updated":"2023-08-30 05:16:16.000000000","message":"This is not required anymore, right?","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a30f2e6aeaca8d3498e65951cc3d7bfa7ed81087","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"class _HashCalculationFailed(exception.GlanceException):"},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    def __init__(self, message):"},{"line_number":40,"context_line":"        super(_HashCalculationFailed, self).__init__(message)"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"class _InvalidLocation(exception.GlanceException):"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    def __init__(self, message):"}],"source_content_type":"text/x-python","patch_set":24,"id":"387a569d_f97a73ab","line":42,"range":{"start_line":36,"start_character":0,"end_line":42,"end_character":0},"in_reply_to":"2a48f05f_91392d24","updated":"2023-08-30 08:44:58.000000000","message":"Done","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ed338df9246e20efe7a3ed19891f4320e66963d5","unresolved":true,"context_lines":[{"line_number":94,"context_line":"        self.image_repo.save(image)"},{"line_number":95,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self.image_repo.save(image)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":100,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails"}],"source_content_type":"text/x-python","patch_set":24,"id":"876700f4_f2b8b86d","line":97,"range":{"start_line":97,"start_character":8,"end_line":97,"end_character":35},"updated":"2023-08-30 05:11:22.000000000","message":"if needed another PS you can move this call to _set_checksum_and_hash method","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a30f2e6aeaca8d3498e65951cc3d7bfa7ed81087","unresolved":false,"context_lines":[{"line_number":94,"context_line":"        self.image_repo.save(image)"},{"line_number":95,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"        self.image_repo.save(image)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":100,"context_line":"        \"\"\"Set os_hash_algo to None when hash calculation fails"}],"source_content_type":"text/x-python","patch_set":24,"id":"d8f098f1_d998755b","line":97,"range":{"start_line":97,"start_character":8,"end_line":97,"end_character":35},"in_reply_to":"876700f4_f2b8b86d","updated":"2023-08-30 08:44:58.000000000","message":"Done","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ed338df9246e20efe7a3ed19891f4320e66963d5","unresolved":true,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"cd3b3abb_1c30a5d3","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"updated":"2023-08-30 05:11:22.000000000","message":"This will fail here as msg is not defined in this scope.\nIt also means that this scenario is not covered in testing?","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"19078cd2e17ea9e5c7fb122480bf99a1ba354d82","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"f7d79f2d_75658342","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"in_reply_to":"04b2f4ef_c5be9abb","updated":"2023-08-31 07:58:47.000000000","message":"Done","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4841434772bb72117909095d3ebef9d3fd614f55","unresolved":true,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"e5e94776_33fc1ba6","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"in_reply_to":"69d06284_446ef7e4","updated":"2023-08-30 10:16:40.000000000","message":"Strange, it should always fail.","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5dcbd6735ac5cd521b581122f2baa3423721a82f","unresolved":true,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"04b2f4ef_c5be9abb","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"in_reply_to":"abd2fb27_f8cc54b3","updated":"2023-08-30 15:19:05.000000000","message":"This AttributeError will happen if hash calculation fails and os_hash_value is not set to image.","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a30f2e6aeaca8d3498e65951cc3d7bfa7ed81087","unresolved":true,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"69d06284_446ef7e4","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"in_reply_to":"cd3b3abb_1c30a5d3","updated":"2023-08-30 08:44:58.000000000","message":"Actually is never failed, ideally it should.\nI\u0027m checking it in the test now.","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"772ee4dd37760a272f1b0cd9105337a6a09f6083","unresolved":true,"context_lines":[{"line_number":139,"context_line":"                    raise exception.Conflict(msg)"},{"line_number":140,"context_line":"        except (AttributeError, exception.Conflict):"},{"line_number":141,"context_line":"            raise exception.InvalidParameterValue(value\u003dv, param\u003dk,"},{"line_number":142,"context_line":"                                                  extra_msg\u003dmsg)"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":145,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":24,"id":"abd2fb27_f8cc54b3","line":142,"range":{"start_line":142,"start_character":50,"end_line":142,"end_character":63},"in_reply_to":"e5e94776_33fc1ba6","updated":"2023-08-30 15:06:36.000000000","message":"Ok, I tested it locally and found that if condition passes at line 128 then msg variable is available in except block at line 135, but if it getattr fails then it raises error,\n\nNameError: name \u0027msg\u0027 is not defined\n\nSo line 133 should be changed to;\n\nexcept (AttributeError, exception.Conflict) as e:\n     \nand msg should be e.msg at line 135\n     \nAlso I failed to notice earlier that now we are not passing checksum in val_data so we can eliminate the use of for loop here. (Sorry for late noticing it).\n\ntry:\n    if val_data[\u0027os_hash_algo\u0027] !\u003d getattr(image, \u0027os_hash_algo\u0027):\n         msg \u003d \".....\"\n         raise exception.Conflict(msg)\nexcept (AttributeError, exception.Conflict) as e:\n     raise exception.InvalidParameterValue(value\u003dval_data[\u0027os_hash_algo\u0027], param\u003d\u0027os_hash_algo\u0027, extra_msg\u003de.msg)","commit_id":"afd0949070dc859ae31095d42443a1ca2c161546"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"92d18b734dd19e739dacd67ab3a19fce5e4906e4","unresolved":true,"context_lines":[{"line_number":56,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":57,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":58,"context_line":"            retries +\u003d 1"},{"line_number":59,"context_line":"            LOG.debug(\"Retry no \u0027%s\u0027 for hash and checksum calculation\","},{"line_number":60,"context_line":"                      retries)"},{"line_number":61,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"67f5857d_d177c753","line":59,"range":{"start_line":59,"start_character":23,"end_line":59,"end_character":70},"updated":"2023-11-08 12:10:49.000000000","message":"nit: Retrying hash and checksum calculation for \u0027%s time\u0027.","commit_id":"dcb543aee27acab86313292c1e0768e02e404f61"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"02f07dc4167f7a06eadfe8f940b12d97145724d9","unresolved":false,"context_lines":[{"line_number":56,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":57,"context_line":"        while image.checksum is None and retries \u003c CONF.http_retries:"},{"line_number":58,"context_line":"            retries +\u003d 1"},{"line_number":59,"context_line":"            LOG.debug(\"Retry no \u0027%s\u0027 for hash and checksum calculation\","},{"line_number":60,"context_line":"                      retries)"},{"line_number":61,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":62,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"af94d20d_86e60be2","line":59,"range":{"start_line":59,"start_character":23,"end_line":59,"end_character":70},"in_reply_to":"67f5857d_d177c753","updated":"2023-12-05 14:12:38.000000000","message":"Done","commit_id":"dcb543aee27acab86313292c1e0768e02e404f61"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"92d18b734dd19e739dacd67ab3a19fce5e4906e4","unresolved":true,"context_lines":[{"line_number":95,"context_line":"                msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":96,"context_line":"                         \"image location %(location)s is deleted \") %"},{"line_number":97,"context_line":"                       {\u0027image_id\u0027: self.image_id, \u0027location\u0027: location})"},{"line_number":98,"context_line":"                LOG.warning(msg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def execute(self):"},{"line_number":101,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":30,"id":"c3e64aed_2e84131b","line":98,"updated":"2023-11-08 12:10:49.000000000","message":"Need to cover this scenario in tests/tempest as well","commit_id":"194522b6201a22eeac542e26485f77ec8b5c40bd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"02f07dc4167f7a06eadfe8f940b12d97145724d9","unresolved":true,"context_lines":[{"line_number":95,"context_line":"                msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":96,"context_line":"                         \"image location %(location)s is deleted \") %"},{"line_number":97,"context_line":"                       {\u0027image_id\u0027: self.image_id, \u0027location\u0027: location})"},{"line_number":98,"context_line":"                LOG.warning(msg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def execute(self):"},{"line_number":101,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":30,"id":"73e35643_c9e24aab","line":98,"in_reply_to":"1389fe83_b8c507a1","updated":"2023-12-05 14:12:38.000000000","message":"Updated the NOTE \u0026 since location.pop() will mark the location status to \u0027deleted\u0027 , removed the related check as well.","commit_id":"194522b6201a22eeac542e26485f77ec8b5c40bd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"2754b375879cf71ebb0d357a244e9f1ffc346ed1","unresolved":false,"context_lines":[{"line_number":95,"context_line":"                msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":96,"context_line":"                         \"image location %(location)s is deleted \") %"},{"line_number":97,"context_line":"                       {\u0027image_id\u0027: self.image_id, \u0027location\u0027: location})"},{"line_number":98,"context_line":"                LOG.warning(msg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def execute(self):"},{"line_number":101,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":30,"id":"0bacf093_007639ac","line":98,"in_reply_to":"73e35643_c9e24aab","updated":"2024-01-02 12:00:43.000000000","message":"Done","commit_id":"194522b6201a22eeac542e26485f77ec8b5c40bd"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"fab345ce6d3659be332c949be35cf0764cd0c9b6","unresolved":true,"context_lines":[{"line_number":95,"context_line":"                msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":96,"context_line":"                         \"image location %(location)s is deleted \") %"},{"line_number":97,"context_line":"                       {\u0027image_id\u0027: self.image_id, \u0027location\u0027: location})"},{"line_number":98,"context_line":"                LOG.warning(msg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def execute(self):"},{"line_number":101,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":30,"id":"1389fe83_b8c507a1","line":98,"in_reply_to":"c2167757_88810861","updated":"2023-12-04 12:49:35.000000000","message":"ok, so after debugging this more i can see that the location is getting marked as deleted during the locations.pop() which we are doing in the revert call and image is remaining in active status since we are not marking it as deleted. Are we supposed to mark the image to deleted when we pop out the location? then we don\u0027t need to do this deletion stuff in the above exception and we can just have the warning.","commit_id":"194522b6201a22eeac542e26485f77ec8b5c40bd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7025163160fa52328a5425203ee821e87071ebbb","unresolved":true,"context_lines":[{"line_number":95,"context_line":"                msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":96,"context_line":"                         \"image location %(location)s is deleted \") %"},{"line_number":97,"context_line":"                       {\u0027image_id\u0027: self.image_id, \u0027location\u0027: location})"},{"line_number":98,"context_line":"                LOG.warning(msg)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"    def execute(self):"},{"line_number":101,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":30,"id":"c2167757_88810861","line":98,"in_reply_to":"c3e64aed_2e84131b","updated":"2023-11-08 14:00:02.000000000","message":"I think it\u0027s important to find out why on delete call image location status is updated to deleted but image status is not updated as deleted. This could be a serious issue here if we are deleting the image from rbd, marking location as deleted but image is still active and returns can not delete image as it is used by rbd response to user.","commit_id":"194522b6201a22eeac542e26485f77ec8b5c40bd"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"1be870b47ba95bf8a6583ef15c011980b265a38e","unresolved":true,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"084ef5a1_216cde51","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"updated":"2023-12-06 05:36:13.000000000","message":"I am confused here, we are catching NotFound here, which technically means image is already deleted, right? Then why are we marking it deleted it again?\n\nIMO, Need to understand image delete API here, where it deletes the location from rbd but fails to clear the location and mark image as deleted and fix it explicitly there.\n\nAlso, here we are continuing the flow, so at the end when user executes location api and in the end it will not be shown in the list he will be confused as he will not have access to logs. (Even service/admin user) will not be able to guess whether snapshot is completed or not without looking at logs. So instead of completing successfully should we terminate the flow (in this case consumers needs to handle this case as well)?","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"2754b375879cf71ebb0d357a244e9f1ffc346ed1","unresolved":true,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"789749ce_70348913","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"in_reply_to":"084ef5a1_216cde51","updated":"2024-01-02 12:00:43.000000000","message":"As we have already discussed, this is a ceph side regression, so we will keep this marking image \u0027deleted\u0027 part as a temp workaround and once ceph issue is fixed we will just keep the warning message here.","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"41053229f9770c2ab1260d4be089cde37476eb63","unresolved":false,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"fa3d970d_be16c85b","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"in_reply_to":"3d07b7ca_14edcfa0","updated":"2024-01-11 07:32:28.000000000","message":"Acknowledged","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"80bdc622392f45dc6d64ccf1b7a959e4df9aab72","unresolved":true,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"3d07b7ca_14edcfa0","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"in_reply_to":"72505348_2896dd06","updated":"2024-01-10 15:20:29.000000000","message":"I think the spec uses HTTP as the example, but I don\u0027t think it\u0027s the only situation where someone would provide validation data. If I\u0027m moving my image from one cloud to another, or even just uploading one I created locally, I would expect to want to provide the hash if I, for example, wanted to make sure the cloud provider didn\u0027t modify it before it\u0027s available.","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"210a5c188af33ecdc77c8a08a0bca7471eb3f89c","unresolved":true,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"c4d7e59b_4628d660","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"in_reply_to":"789749ce_70348913","updated":"2024-01-08 15:01:32.000000000","message":"What about in the future when the bug is fixed but someone deletes the image in ceph directly? Seems like if we fail to calculate the checksum we should abort this whole flow. Not only to make it visible to the user, but also to avoid the case where we silently (from the user\u0027s perspective) continue on to the next step. Presumably the VerifyValidationData step will fail because we didn\u0027t actually set the checksum and thus it will just indicate to the user that the verify failed?","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"ccf5e82afcc57a1bf5e588c8da1c3fae7ee22aa1","unresolved":true,"context_lines":[{"line_number":87,"context_line":"            # location without data hence need to mark the image to \"deleted\""},{"line_number":88,"context_line":"            # by popping out the location since we cannot move \u0027active\u0027 image"},{"line_number":89,"context_line":"            # back to \u0027queued\u0027 state."},{"line_number":90,"context_line":"            if image.locations:"},{"line_number":91,"context_line":"                image.locations.pop()"},{"line_number":92,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":93,"context_line":"                self.image_repo.save(image)"},{"line_number":94,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":95,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":96,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":97,"context_line":"            LOG.warning(msg)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def execute(self):"},{"line_number":100,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":31,"id":"72505348_2896dd06","line":97,"range":{"start_line":90,"start_character":12,"end_line":97,"end_character":28},"in_reply_to":"c4d7e59b_4628d660","updated":"2024-01-09 14:27:20.000000000","message":"According to the spec, I think the validation data is passed in case of http store case only, so VerifyValidationData task will not be executed even if we don\u0027t abort the flow after CalculateHash failure.\n\nBut yeah it makes sense to me irrespective of the store, if CalculateHash fails with NotFound then flow should be aborted to indicate the user about the exact error. I will update the patch accordingly.","commit_id":"0378ed442ab02477f1239db1b23e49745e4c2575"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":true,"context_lines":[{"line_number":38,"context_line":"class _HashCalculationFailed(exception.GlanceException):"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def __init__(self, message):"},{"line_number":41,"context_line":"        super(_HashCalculationFailed, self).__init__(message)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class _InvalidLocation(exception.GlanceException):"}],"source_content_type":"text/x-python","patch_set":33,"id":"2e14b2bf_91360303","line":41,"updated":"2024-01-16 15:22:31.000000000","message":"This is a nit, but these exceptions don\u0027t need these overrides, right? This pattern is common when you\u0027re adding a custom-formatted message for them, but you\u0027re not.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"37e51127e0770decf7c240f34381c8d197ddaf65","unresolved":false,"context_lines":[{"line_number":38,"context_line":"class _HashCalculationFailed(exception.GlanceException):"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def __init__(self, message):"},{"line_number":41,"context_line":"        super(_HashCalculationFailed, self).__init__(message)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class _InvalidLocation(exception.GlanceException):"}],"source_content_type":"text/x-python","patch_set":33,"id":"80414726_13eb591d","line":41,"in_reply_to":"01eb0db9_bb5a7c48","updated":"2024-01-22 11:07:07.000000000","message":"Acknowledged","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"942b2726d7ab5a2d602b1bb1695a642ffef3e4dd","unresolved":true,"context_lines":[{"line_number":38,"context_line":"class _HashCalculationFailed(exception.GlanceException):"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    def __init__(self, message):"},{"line_number":41,"context_line":"        super(_HashCalculationFailed, self).__init__(message)"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class _InvalidLocation(exception.GlanceException):"}],"source_content_type":"text/x-python","patch_set":33,"id":"01eb0db9_bb5a7c48","line":41,"in_reply_to":"2e14b2bf_91360303","updated":"2024-01-17 14:26:25.000000000","message":"ohh yes, I will update this in next PS","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":true,"context_lines":[{"line_number":97,"context_line":"            if image.locations:"},{"line_number":98,"context_line":"                image.locations.pop()"},{"line_number":99,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":100,"context_line":"                self.image_repo.save(image)"},{"line_number":101,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":102,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":103,"context_line":"                   {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":33,"id":"6199a011_10700841","line":100,"updated":"2024-01-16 15:22:31.000000000","message":"Hmm, can\u0027t `image_repo.save()` raise NotFound if the image itself was deleted through the API? If so, we\u0027ll just try (and fail) to do it again here, eventually raising the `NotFound` instead of the actual exception on L105, and skipping the log.\n\nI think we need to swallow another `NotFound` here right?","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"37e51127e0770decf7c240f34381c8d197ddaf65","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            if image.locations:"},{"line_number":98,"context_line":"                image.locations.pop()"},{"line_number":99,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":100,"context_line":"                self.image_repo.save(image)"},{"line_number":101,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":102,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":103,"context_line":"                   {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":33,"id":"419c4c45_8eda81f8","line":100,"in_reply_to":"27101bda_fd00f9ac","updated":"2024-01-22 11:07:07.000000000","message":"Done","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"942b2726d7ab5a2d602b1bb1695a642ffef3e4dd","unresolved":true,"context_lines":[{"line_number":97,"context_line":"            if image.locations:"},{"line_number":98,"context_line":"                image.locations.pop()"},{"line_number":99,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":100,"context_line":"                self.image_repo.save(image)"},{"line_number":101,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":102,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":103,"context_line":"                   {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":33,"id":"cd50a98c_74928dcb","line":100,"in_reply_to":"6199a011_10700841","updated":"2024-01-17 14:26:25.000000000","message":"This save will be called only if the location of the image is not deleted from the DB but image data is deleted from the backend but NotFound is raised from backend only. And here I\u0027m just trying to update the status to \u0027deleted\u0027 in the DB so I don\u0027t think save will raise NotFound since the image entry will be exist there in DB. \n\nPlease correct me if i\u0027m wrong.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1764e7871eac977006a994bcb0fedb16583c1672","unresolved":true,"context_lines":[{"line_number":97,"context_line":"            if image.locations:"},{"line_number":98,"context_line":"                image.locations.pop()"},{"line_number":99,"context_line":"                image.status \u003d \u0027deleted\u0027"},{"line_number":100,"context_line":"                self.image_repo.save(image)"},{"line_number":101,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":102,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":103,"context_line":"                   {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":33,"id":"27101bda_fd00f9ac","line":100,"in_reply_to":"cd50a98c_74928dcb","updated":"2024-01-17 16:24:04.000000000","message":"I\u0027m talking about a scenario where I delete the image in glance *and* ceph. By my reading, `save()` will raise if the image is deleted unless you\u0027re using a context with `can_see_deleted\u003dTrue`. I don\u0027t think we should change the context, here, just swallow any `NotFound` that raises when we try to save.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":true,"context_lines":[{"line_number":125,"context_line":"            image.locations.pop()"},{"line_number":126,"context_line":"        if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":127,"context_line":"            self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":33,"id":"cadd377b_35925231","line":128,"updated":"2024-01-16 15:22:31.000000000","message":"Presumably we could fail later with a `NotFound` for similar reasons as above. Should we catch and ignore that exception here as well to avoid noise and disruption in the revert path? There are a lot of `image_repo.save` calls in these `execute` and `revert` methods.. I wonder if we should do the same for all of them to avoid the entire revert path breaking if we get into that situation.\n\nI think, especially since this is new behavior, you could imagine a lot of people uploading an image, not understanding why it\u0027s taking so long to go active, and then deleting it and trying again...","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"37e51127e0770decf7c240f34381c8d197ddaf65","unresolved":false,"context_lines":[{"line_number":125,"context_line":"            image.locations.pop()"},{"line_number":126,"context_line":"        if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":127,"context_line":"            self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":128,"context_line":"        self.image_repo.save(image)"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":33,"id":"30078dc6_1f236a2d","line":128,"in_reply_to":"cadd377b_35925231","updated":"2024-01-22 11:07:07.000000000","message":"Done","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":true,"context_lines":[{"line_number":159,"context_line":"        except (AttributeError, exception.Conflict) as e:"},{"line_number":160,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":161,"context_line":"                value\u003dself.val_data[\u0027os_hash_algo\u0027], param\u003d\u0027os_hash_algo\u0027,"},{"line_number":162,"context_line":"                extra_msg\u003de.msg)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":165,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":33,"id":"7f6ae8c9_f3514fe5","line":162,"updated":"2024-01-16 15:22:31.000000000","message":"This is fairly confusing way to do this, IMHO. This is basically a conditional raise inside an exception handler for that exception, you might as well not catch the Conflict and just raise thing you\u0027re actually looking for I think.\n\nI guess this is just a personal preference thing, so don\u0027t change it unless others agree, I just think this is part to read.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a84bed3649409abbc717fb658645e03be0588acd","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        except (AttributeError, exception.Conflict) as e:"},{"line_number":160,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":161,"context_line":"                value\u003dself.val_data[\u0027os_hash_algo\u0027], param\u003d\u0027os_hash_algo\u0027,"},{"line_number":162,"context_line":"                extra_msg\u003de.msg)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":165,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":33,"id":"58433aed_fe839ad3","line":162,"in_reply_to":"3ec7fdad_fb74b99c","updated":"2024-02-01 10:35:21.000000000","message":"Acknowledged","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ab4deada17a6ccdf0f856652e9b13716ed04da78","unresolved":true,"context_lines":[{"line_number":159,"context_line":"        except (AttributeError, exception.Conflict) as e:"},{"line_number":160,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":161,"context_line":"                value\u003dself.val_data[\u0027os_hash_algo\u0027], param\u003d\u0027os_hash_algo\u0027,"},{"line_number":162,"context_line":"                extra_msg\u003de.msg)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":165,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":33,"id":"3ec7fdad_fb74b99c","line":162,"in_reply_to":"7f6ae8c9_f3514fe5","updated":"2024-01-30 06:48:41.000000000","message":"+1\n\nAlso I am not sure whether it will raise attribute error because we are sure that os_hash_value is set at this moment and that is why we are validating it with user provided value.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ab4deada17a6ccdf0f856652e9b13716ed04da78","unresolved":true,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 RedHat Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":36,"id":"80c274fa_383a0a52","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2024-01-30 06:48:41.000000000","message":"nit 2024","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a84bed3649409abbc717fb658645e03be0588acd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 RedHat Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":36,"id":"7d992374_986cd3ee","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"80c274fa_383a0a52","updated":"2024-02-01 10:35:21.000000000","message":"Done","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ab4deada17a6ccdf0f856652e9b13716ed04da78","unresolved":true,"context_lines":[{"line_number":172,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":173,"context_line":"        setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":174,"context_line":"        setattr(image, \u0027checksum\u0027, None)"},{"line_number":175,"context_line":"        self.image_repo.save(image)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":36,"id":"8b57bb07_434fb255","line":175,"updated":"2024-01-30 06:48:41.000000000","message":"I see in some revert method you are catching NotFound exception, why not here?","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"18d487c0f15767d76f3437e9901a89a9a2ae17c9","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":173,"context_line":"        setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":174,"context_line":"        setattr(image, \u0027checksum\u0027, None)"},{"line_number":175,"context_line":"        self.image_repo.save(image)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":36,"id":"48d9ac0c_b9156502","line":175,"in_reply_to":"5095aa17_32dd2e93","updated":"2024-02-15 09:09:17.000000000","message":"Acknowledged","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a84bed3649409abbc717fb658645e03be0588acd","unresolved":true,"context_lines":[{"line_number":172,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":173,"context_line":"        setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":174,"context_line":"        setattr(image, \u0027checksum\u0027, None)"},{"line_number":175,"context_line":"        self.image_repo.save(image)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":36,"id":"d97cdaf6_2aec1c2d","line":175,"in_reply_to":"8b57bb07_434fb255","updated":"2024-02-01 10:35:21.000000000","message":"I have caught NotFound for save() only in those revert calls which will be executed after HashCalculation failure due to image deletion when hash calculation is ongoing.","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"4fd3eb92a9ccd467f0a6f805c399045636e20846","unresolved":true,"context_lines":[{"line_number":172,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":173,"context_line":"        setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":174,"context_line":"        setattr(image, \u0027checksum\u0027, None)"},{"line_number":175,"context_line":"        self.image_repo.save(image)"},{"line_number":176,"context_line":""},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":36,"id":"5095aa17_32dd2e93","line":175,"in_reply_to":"d97cdaf6_2aec1c2d","updated":"2024-02-06 05:38:35.000000000","message":"Image can get deleted any time between any of these tasks, so ideally it should be caught in all revert calls.","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"095c3d54ed86a8b0cc2f4bf7f41c5501b2730b83","unresolved":true,"context_lines":[{"line_number":124,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            pass"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":38,"id":"ff15a217_0b75ef47","line":127,"updated":"2024-02-12 22:38:40.000000000","message":"It would be nice to have some calls to LOG.debug() in the execute/revert methods, and also in the \"empty excepts\". This would come in handy when debugging issues.","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8dcda85763031e23b175474098ab5a1660ea42fe","unresolved":false,"context_lines":[{"line_number":124,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            pass"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":38,"id":"29fb3ea0_0c1c83fe","line":127,"in_reply_to":"dc2b6465_b68cf12f","updated":"2024-02-15 10:32:59.000000000","message":"Done","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"18d487c0f15767d76f3437e9901a89a9a2ae17c9","unresolved":true,"context_lines":[{"line_number":124,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            pass"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":38,"id":"dc2b6465_b68cf12f","line":127,"in_reply_to":"ff15a217_0b75ef47","updated":"2024-02-15 09:09:17.000000000","message":"Well, this NotFound will be raised only when image is deleted during hash calculation and this task fails, for which details error msg is already added at Line #98. But still if you think debug log is also required the i will add it","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retries):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"},{"line_number":66,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            for chunk in image.get_data():"}],"source_content_type":"text/x-python","patch_set":39,"id":"b2ff3b81_bcb96a2d","line":65,"range":{"start_line":65,"start_character":44,"end_line":65,"end_character":47},"updated":"2024-02-19 07:03:55.000000000","message":"why are you converting it to str?\nAFAIK self.hashing_algo is str only, right?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            self._set_checksum_and_hash(image, retries)"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retries):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(str(self.hashing_algo))"},{"line_number":66,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":67,"context_line":"        try:"},{"line_number":68,"context_line":"            for chunk in image.get_data():"}],"source_content_type":"text/x-python","patch_set":39,"id":"bcd28bf5_69ee56e6","line":65,"range":{"start_line":65,"start_character":44,"end_line":65,"end_character":47},"in_reply_to":"b2ff3b81_bcb96a2d","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":88,"context_line":"            # Once this ceph side issue is fixed, we\u0027ll keep only the"},{"line_number":89,"context_line":"            # warning message here and will remove the marking image \u0027deleted\u0027"},{"line_number":90,"context_line":"            # part which is a temporary workaround."},{"line_number":91,"context_line":"            try:"},{"line_number":92,"context_line":"                if image.locations:"},{"line_number":93,"context_line":"                    image.locations.pop()"},{"line_number":94,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":95,"context_line":"                    self.image_repo.save(image)"},{"line_number":96,"context_line":"            except exception.NotFound:"},{"line_number":97,"context_line":"                pass"},{"line_number":98,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":99,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":100,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":101,"context_line":"            raise exception.NotFound(msg)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def execute(self):"},{"line_number":104,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":39,"id":"00d8fec7_a22da9fc","line":101,"range":{"start_line":91,"start_character":12,"end_line":101,"end_character":41},"updated":"2024-02-19 07:03:55.000000000","message":"Do we have a functional test to verify this scenario?\nThe reason I am asking this because, at line 83 NotFound is caught which means image is deleted from the glance backend, and again line 96 NotFound is caught while changing image.status to deleted.\n\nSo my question is are we verifying that image is set to deleted anywhere?\nWhen will we get NotFound at line 96?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":88,"context_line":"            # Once this ceph side issue is fixed, we\u0027ll keep only the"},{"line_number":89,"context_line":"            # warning message here and will remove the marking image \u0027deleted\u0027"},{"line_number":90,"context_line":"            # part which is a temporary workaround."},{"line_number":91,"context_line":"            try:"},{"line_number":92,"context_line":"                if image.locations:"},{"line_number":93,"context_line":"                    image.locations.pop()"},{"line_number":94,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":95,"context_line":"                    self.image_repo.save(image)"},{"line_number":96,"context_line":"            except exception.NotFound:"},{"line_number":97,"context_line":"                pass"},{"line_number":98,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":99,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":100,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":101,"context_line":"            raise exception.NotFound(msg)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def execute(self):"},{"line_number":104,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":39,"id":"24587611_3d4bcb61","line":101,"range":{"start_line":91,"start_character":12,"end_line":101,"end_character":41},"in_reply_to":"00d8fec7_a22da9fc","updated":"2024-02-20 10:24:30.000000000","message":"This was suggested by Dan to swallow one more not found when image is deleted from glance as well as backend and save() will raise NotFound if the image is deleted and context is without can_see_deleted\u003dTrue,\n\nhttps://review.opendev.org/c/openstack/glance/+/886749/33..34/glance/async_/flows/location_import.py\n\nThere is no functional test for this scenario since in functional tests http store has been used and deletion is not allowed for http store. I will try to cover this in tempest","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2eef4139e153ce92a6a0624e4584d868db2f2805","unresolved":true,"context_lines":[{"line_number":88,"context_line":"            # Once this ceph side issue is fixed, we\u0027ll keep only the"},{"line_number":89,"context_line":"            # warning message here and will remove the marking image \u0027deleted\u0027"},{"line_number":90,"context_line":"            # part which is a temporary workaround."},{"line_number":91,"context_line":"            try:"},{"line_number":92,"context_line":"                if image.locations:"},{"line_number":93,"context_line":"                    image.locations.pop()"},{"line_number":94,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":95,"context_line":"                    self.image_repo.save(image)"},{"line_number":96,"context_line":"            except exception.NotFound:"},{"line_number":97,"context_line":"                pass"},{"line_number":98,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":99,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":100,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":101,"context_line":"            raise exception.NotFound(msg)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def execute(self):"},{"line_number":104,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":39,"id":"6628bf98_7a872f5c","line":101,"range":{"start_line":91,"start_character":12,"end_line":101,"end_character":41},"in_reply_to":"24587611_3d4bcb61","updated":"2024-02-20 14:18:09.000000000","message":"may be need to double check with Dan, because you are catching exception.NotFound, doing nothing and then again raising exception.NotFound, maybe you should use save_and_reraise_exception.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8b0efa8eb4d65f65595b48b8a73737d638682829","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            # Once this ceph side issue is fixed, we\u0027ll keep only the"},{"line_number":89,"context_line":"            # warning message here and will remove the marking image \u0027deleted\u0027"},{"line_number":90,"context_line":"            # part which is a temporary workaround."},{"line_number":91,"context_line":"            try:"},{"line_number":92,"context_line":"                if image.locations:"},{"line_number":93,"context_line":"                    image.locations.pop()"},{"line_number":94,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":95,"context_line":"                    self.image_repo.save(image)"},{"line_number":96,"context_line":"            except exception.NotFound:"},{"line_number":97,"context_line":"                pass"},{"line_number":98,"context_line":"            msg \u003d (_(\"Failed to calculate checksum of %(image_id)s as \""},{"line_number":99,"context_line":"                     \"image data has been deleted from the backend\") %"},{"line_number":100,"context_line":"                   {\u0027image_id\u0027: self.image_id})"},{"line_number":101,"context_line":"            raise exception.NotFound(msg)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def execute(self):"},{"line_number":104,"context_line":"        retries \u003d 0"}],"source_content_type":"text/x-python","patch_set":39,"id":"782b26df_3539a1d8","line":101,"range":{"start_line":91,"start_character":12,"end_line":101,"end_character":41},"in_reply_to":"6628bf98_7a872f5c","updated":"2024-02-21 13:01:56.000000000","message":"Acknowledged","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":107,"context_line":"        if self.image_status:"},{"line_number":108,"context_line":"            image.status \u003d self.image_status"},{"line_number":109,"context_line":"            self.image_repo.save(image, from_state\u003d\u0027queued\u0027)"},{"line_number":110,"context_line":"        self.image_repo.save(image)"},{"line_number":111,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":39,"id":"0fb7a4b8_d4c5e865","line":110,"updated":"2024-02-19 07:03:55.000000000","message":"Don\u0027t you think if condition at line 107 is true then save will be called two times?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        if self.image_status:"},{"line_number":108,"context_line":"            image.status \u003d self.image_status"},{"line_number":109,"context_line":"            self.image_repo.save(image, from_state\u003d\u0027queued\u0027)"},{"line_number":110,"context_line":"        self.image_repo.save(image)"},{"line_number":111,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":39,"id":"be004f6e_d94a7eda","line":110,"in_reply_to":"0fb7a4b8_d4c5e865","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":124,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":128,"context_line":"                      self.image_id)"}],"source_content_type":"text/x-python","patch_set":39,"id":"fdc807eb_793c2f5b","line":125,"updated":"2024-02-19 07:03:55.000000000","message":"ditto, here also save will be called two times if line 123 evaluates to true.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        try:"},{"line_number":123,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":124,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":128,"context_line":"                      self.image_id)"}],"source_content_type":"text/x-python","patch_set":39,"id":"fdaaa3cf_72e3a88b","line":125,"in_reply_to":"fdc807eb_793c2f5b","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":128,"context_line":"                      self.image_id)"},{"line_number":129,"context_line":"            pass"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"2bee0528_ba3452f6","line":129,"range":{"start_line":129,"start_character":12,"end_line":129,"end_character":16},"updated":"2024-02-19 07:03:55.000000000","message":"No need of pass here.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":128,"context_line":"                      self.image_id)"},{"line_number":129,"context_line":"            pass"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"class _VerifyValidationData(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"9168e166_db62a869","line":129,"range":{"start_line":129,"start_character":12,"end_line":129,"end_character":16},"in_reply_to":"2bee0528_ba3452f6","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":153,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":154,"context_line":"            msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":155,"context_line":"                     \"%s (%s)\") % ("},{"line_number":156,"context_line":"                   \u0027os_hash_value\u0027, self.val_data[\u0027os_hash_value\u0027],"},{"line_number":157,"context_line":"                   \u0027os_hash_value\u0027, getattr(image, \u0027os_hash_value\u0027)))"}],"source_content_type":"text/x-python","patch_set":39,"id":"09dbd69e_1cfe64eb","line":154,"range":{"start_line":154,"start_character":22,"end_line":154,"end_character":24},"updated":"2024-02-19 07:03:55.000000000","message":"I think you can directly use os_hash_value here.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":151,"context_line":""},{"line_number":152,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":153,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":154,"context_line":"            msg \u003d (_(\"%s (%s) not matched with actual \""},{"line_number":155,"context_line":"                     \"%s (%s)\") % ("},{"line_number":156,"context_line":"                   \u0027os_hash_value\u0027, self.val_data[\u0027os_hash_value\u0027],"},{"line_number":157,"context_line":"                   \u0027os_hash_value\u0027, getattr(image, \u0027os_hash_value\u0027)))"}],"source_content_type":"text/x-python","patch_set":39,"id":"bdb09b25_ba4dc0c8","line":154,"range":{"start_line":154,"start_character":22,"end_line":154,"end_character":24},"in_reply_to":"09dbd69e_1cfe64eb","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":155,"context_line":"                     \"%s (%s)\") % ("},{"line_number":156,"context_line":"                   \u0027os_hash_value\u0027, self.val_data[\u0027os_hash_value\u0027],"},{"line_number":157,"context_line":"                   \u0027os_hash_value\u0027, getattr(image, \u0027os_hash_value\u0027)))"},{"line_number":158,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":159,"context_line":"                value\u003dself.val_data[\u0027os_hash_value\u0027], param\u003d\u0027os_hash_value\u0027,"},{"line_number":160,"context_line":"                extra_msg\u003dmsg)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":163,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":39,"id":"561bd97f_14598d51","line":160,"range":{"start_line":158,"start_character":12,"end_line":160,"end_character":30},"updated":"2024-02-19 07:03:55.000000000","message":"nit:\nI think you can avoid here passing value and param since your msg already include those details.\n\notherwise your end message will be too big, something like;\n\nInvalid value \u0027xxxxxxxxxxxxx\u0027 for parameter \u0027os_hash_value\u0027: os_hash_value (xxxxxxxxxxxxx) not matched with actual os_hash_value (yyyyyyyyyyyyyyyyyy)","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":155,"context_line":"                     \"%s (%s)\") % ("},{"line_number":156,"context_line":"                   \u0027os_hash_value\u0027, self.val_data[\u0027os_hash_value\u0027],"},{"line_number":157,"context_line":"                   \u0027os_hash_value\u0027, getattr(image, \u0027os_hash_value\u0027)))"},{"line_number":158,"context_line":"            raise exception.InvalidParameterValue("},{"line_number":159,"context_line":"                value\u003dself.val_data[\u0027os_hash_value\u0027], param\u003d\u0027os_hash_value\u0027,"},{"line_number":160,"context_line":"                extra_msg\u003dmsg)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":163,"context_line":"        \"\"\"Set image status back to queued and"}],"source_content_type":"text/x-python","patch_set":39,"id":"ffcb7027_a6a47fb4","line":160,"range":{"start_line":158,"start_character":12,"end_line":160,"end_character":30},"in_reply_to":"561bd97f_14598d51","updated":"2024-02-20 10:24:30.000000000","message":"Acknowledged","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":176,"context_line":"        except exception.NotFound:"},{"line_number":177,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":178,"context_line":"                      self.image_id)"},{"line_number":179,"context_line":"            pass"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"b6d0a2e6_8dd87630","line":179,"range":{"start_line":179,"start_character":12,"end_line":179,"end_character":16},"updated":"2024-02-19 07:03:55.000000000","message":"No need for pass here.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":176,"context_line":"        except exception.NotFound:"},{"line_number":177,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":178,"context_line":"                      self.image_id)"},{"line_number":179,"context_line":"            pass"},{"line_number":180,"context_line":""},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"class _SetHashValues(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"1901f126_527377ac","line":179,"range":{"start_line":179,"start_character":12,"end_line":179,"end_character":16},"in_reply_to":"b6d0a2e6_8dd87630","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":219,"context_line":"        except exception.NotFound:"},{"line_number":220,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":221,"context_line":"                      self.image_id)"},{"line_number":222,"context_line":"            pass"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"aa334694_c93a13f5","line":222,"range":{"start_line":222,"start_character":12,"end_line":222,"end_character":16},"updated":"2024-02-19 07:03:55.000000000","message":"ditto","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        except exception.NotFound:"},{"line_number":220,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":221,"context_line":"                      self.image_id)"},{"line_number":222,"context_line":"            pass"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"class _UpdateLocationTask(task.Task):"}],"source_content_type":"text/x-python","patch_set":39,"id":"e0ce0299_5259c4ce","line":222,"range":{"start_line":222,"start_character":12,"end_line":222,"end_character":16},"in_reply_to":"aa334694_c93a13f5","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":247,"context_line":"            # as location metadata"},{"line_number":248,"context_line":"            updated_location \u003d {"},{"line_number":249,"context_line":"                \u0027url\u0027: self.url,"},{"line_number":250,"context_line":"                \u0027metadata\u0027: {},"},{"line_number":251,"context_line":"            }"},{"line_number":252,"context_line":"            if CONF.enabled_backends:"},{"line_number":253,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("}],"source_content_type":"text/x-python","patch_set":39,"id":"0a51a1ab_a7b48e3e","line":250,"range":{"start_line":250,"start_character":16,"end_line":250,"end_character":30},"updated":"2024-02-19 07:03:55.000000000","message":"Just curious to know what happens if I don\u0027t pass it?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":247,"context_line":"            # as location metadata"},{"line_number":248,"context_line":"            updated_location \u003d {"},{"line_number":249,"context_line":"                \u0027url\u0027: self.url,"},{"line_number":250,"context_line":"                \u0027metadata\u0027: {},"},{"line_number":251,"context_line":"            }"},{"line_number":252,"context_line":"            if CONF.enabled_backends:"},{"line_number":253,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("}],"source_content_type":"text/x-python","patch_set":39,"id":"65fdf6db_4f90e529","line":250,"range":{"start_line":250,"start_character":16,"end_line":250,"end_character":30},"in_reply_to":"0a51a1ab_a7b48e3e","updated":"2024-02-20 10:24:30.000000000","message":"While adding store identifier in location metadata, metadata \u0027key\u0027 is required.\nhttps://github.com/openstack/glance/blob/master/glance/common/store_utils.py#L244","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2eef4139e153ce92a6a0624e4584d868db2f2805","unresolved":false,"context_lines":[{"line_number":247,"context_line":"            # as location metadata"},{"line_number":248,"context_line":"            updated_location \u003d {"},{"line_number":249,"context_line":"                \u0027url\u0027: self.url,"},{"line_number":250,"context_line":"                \u0027metadata\u0027: {},"},{"line_number":251,"context_line":"            }"},{"line_number":252,"context_line":"            if CONF.enabled_backends:"},{"line_number":253,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("}],"source_content_type":"text/x-python","patch_set":39,"id":"62f2e7e5_cdebd3ad","line":250,"range":{"start_line":250,"start_character":16,"end_line":250,"end_character":30},"in_reply_to":"65fdf6db_4f90e529","updated":"2024-02-20 14:18:09.000000000","message":"Acknowledged","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":285,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":286,"context_line":"        if image.locations:"},{"line_number":287,"context_line":"            image.locations.pop()"},{"line_number":288,"context_line":"        if image.status not in (\u0027queued\u0027, \u0027active\u0027, \u0027deleted\u0027):"},{"line_number":289,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":290,"context_line":"        try:"},{"line_number":291,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":39,"id":"56d0463c_c8735900","line":288,"range":{"start_line":288,"start_character":43,"end_line":288,"end_character":49},"updated":"2024-02-19 07:03:55.000000000","message":"I am doubtful about this check here, possibility of revert get called here is only while saving image to active state, I don\u0027t think image will be ever active in this case.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":285,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":286,"context_line":"        if image.locations:"},{"line_number":287,"context_line":"            image.locations.pop()"},{"line_number":288,"context_line":"        if image.status not in (\u0027queued\u0027, \u0027active\u0027, \u0027deleted\u0027):"},{"line_number":289,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":290,"context_line":"        try:"},{"line_number":291,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7b656bc0_b2f961a0","line":288,"range":{"start_line":288,"start_character":43,"end_line":288,"end_character":49},"in_reply_to":"56d0463c_c8735900","updated":"2024-02-20 10:24:30.000000000","message":"I think this was added when we were raising the exception while hash calculation failure due to IOError, since image was set to active before hash calculation starts. But yeah it\u0027s not now required, removing it.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":285,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":286,"context_line":"        if image.locations:"},{"line_number":287,"context_line":"            image.locations.pop()"},{"line_number":288,"context_line":"        if image.status not in (\u0027queued\u0027, \u0027active\u0027, \u0027deleted\u0027):"},{"line_number":289,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":290,"context_line":"        try:"},{"line_number":291,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":39,"id":"0296596d_1872689d","line":288,"range":{"start_line":288,"start_character":43,"end_line":288,"end_character":49},"in_reply_to":"7b656bc0_b2f961a0","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        except exception.NotFound:"},{"line_number":293,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":294,"context_line":"                      self.image_id)"},{"line_number":295,"context_line":"            pass"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":39,"id":"d48daf05_bb11b896","line":295,"range":{"start_line":295,"start_character":12,"end_line":295,"end_character":16},"updated":"2024-02-19 07:03:55.000000000","message":"Not required","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        except exception.NotFound:"},{"line_number":293,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":294,"context_line":"                      self.image_id)"},{"line_number":295,"context_line":"            pass"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":""},{"line_number":298,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":39,"id":"5bb65d09_c862d620","line":295,"range":{"start_line":295,"start_character":12,"end_line":295,"end_character":16},"in_reply_to":"d48daf05_bb11b896","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2eef4139e153ce92a6a0624e4584d868db2f2805","unresolved":true,"context_lines":[{"line_number":116,"context_line":"           and remove the location by reverting image to queued"},{"line_number":117,"context_line":"           state"},{"line_number":118,"context_line":"        \"\"\""},{"line_number":119,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":120,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":121,"context_line":"        if image.locations:"},{"line_number":122,"context_line":"            image.locations.pop()"}],"source_content_type":"text/x-python","patch_set":40,"id":"05e3db01_859b32c4","line":119,"updated":"2024-02-20 14:18:09.000000000","message":"nit, here also you can get not found, so this should be in try block also","commit_id":"7322339ab6e8b77db8bfbcf3a40b54fe06ae6bc4"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8b0efa8eb4d65f65595b48b8a73737d638682829","unresolved":false,"context_lines":[{"line_number":116,"context_line":"           and remove the location by reverting image to queued"},{"line_number":117,"context_line":"           state"},{"line_number":118,"context_line":"        \"\"\""},{"line_number":119,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":120,"context_line":"        setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":121,"context_line":"        if image.locations:"},{"line_number":122,"context_line":"            image.locations.pop()"}],"source_content_type":"text/x-python","patch_set":40,"id":"59aa941a_0301b1dc","line":119,"in_reply_to":"05e3db01_859b32c4","updated":"2024-02-21 13:01:56.000000000","message":"Done","commit_id":"7322339ab6e8b77db8bfbcf3a40b54fe06ae6bc4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2eef4139e153ce92a6a0624e4584d868db2f2805","unresolved":true,"context_lines":[{"line_number":289,"context_line":"        except exception.NotFound:"},{"line_number":290,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":291,"context_line":"                      self.image_id)"},{"line_number":292,"context_line":"            pass"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":40,"id":"6fb39aeb_ddc054d4","line":292,"range":{"start_line":292,"start_character":0,"end_line":292,"end_character":16},"updated":"2024-02-20 14:18:09.000000000","message":"this is not required.","commit_id":"7322339ab6e8b77db8bfbcf3a40b54fe06ae6bc4"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8b0efa8eb4d65f65595b48b8a73737d638682829","unresolved":false,"context_lines":[{"line_number":289,"context_line":"        except exception.NotFound:"},{"line_number":290,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","},{"line_number":291,"context_line":"                      self.image_id)"},{"line_number":292,"context_line":"            pass"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"def get_flow(**kwargs):"}],"source_content_type":"text/x-python","patch_set":40,"id":"1f895123_7dff220f","line":292,"range":{"start_line":292,"start_character":0,"end_line":292,"end_character":16},"in_reply_to":"6fb39aeb_ddc054d4","updated":"2024-02-21 13:01:56.000000000","message":"Done","commit_id":"7322339ab6e8b77db8bfbcf3a40b54fe06ae6bc4"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d91f93717510b2b13c2e91e56c4e62d0fd0e70cb","unresolved":true,"context_lines":[{"line_number":92,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":93,"context_line":"                if image.locations:"},{"line_number":94,"context_line":"                    image.locations.pop()"},{"line_number":95,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":96,"context_line":"                    self.image_repo.save(image)"},{"line_number":97,"context_line":"                LOG.error(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":98,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":99,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":46,"id":"45ba0c3c_9bf746ff","line":96,"range":{"start_line":95,"start_character":20,"end_line":96,"end_character":47},"updated":"2024-02-27 11:25:44.000000000","message":"I think this two lines should better be out of above if condition. So that we might cover a situation where image locations are popped but image is still not marked as deleted.","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":93,"context_line":"                if image.locations:"},{"line_number":94,"context_line":"                    image.locations.pop()"},{"line_number":95,"context_line":"                    image.status \u003d \u0027deleted\u0027"},{"line_number":96,"context_line":"                    self.image_repo.save(image)"},{"line_number":97,"context_line":"                LOG.error(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":98,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":99,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"}],"source_content_type":"text/x-python","patch_set":46,"id":"e1d6c67a_fd3d7dae","line":96,"range":{"start_line":95,"start_character":20,"end_line":96,"end_character":47},"in_reply_to":"45ba0c3c_9bf746ff","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d91f93717510b2b13c2e91e56c4e62d0fd0e70cb","unresolved":true,"context_lines":[{"line_number":102,"context_line":"        retries \u003d 0"},{"line_number":103,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":104,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":105,"context_line":"        if self.image_status:"},{"line_number":106,"context_line":"            image.status \u003d self.image_status"},{"line_number":107,"context_line":"            self.image_repo.save(image, from_state\u003d\u0027queued\u0027)"},{"line_number":108,"context_line":"        else:"},{"line_number":109,"context_line":"            self.image_repo.save(image)"},{"line_number":110,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":46,"id":"237a8ac6_249276c5","line":109,"range":{"start_line":105,"start_character":8,"end_line":109,"end_character":39},"updated":"2024-02-27 11:25:44.000000000","message":"Can we simply do it something like; (you can ignore it as well)\n\n if image.status \u003d\u003d \u0027queued\u0027:\n     image.status \u003d self.image_status\n self.image_repo.save(image)","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":102,"context_line":"        retries \u003d 0"},{"line_number":103,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":104,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":105,"context_line":"        if self.image_status:"},{"line_number":106,"context_line":"            image.status \u003d self.image_status"},{"line_number":107,"context_line":"            self.image_repo.save(image, from_state\u003d\u0027queued\u0027)"},{"line_number":108,"context_line":"        else:"},{"line_number":109,"context_line":"            self.image_repo.save(image)"},{"line_number":110,"context_line":"        self._set_checksum_and_hash(image, retries)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":46,"id":"7dcf3ce6_90ce3393","line":109,"range":{"start_line":105,"start_character":8,"end_line":109,"end_character":39},"in_reply_to":"237a8ac6_249276c5","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d91f93717510b2b13c2e91e56c4e62d0fd0e70cb","unresolved":true,"context_lines":[{"line_number":120,"context_line":"            if image.locations:"},{"line_number":121,"context_line":"                image.locations.pop()"},{"line_number":122,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":123,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":46,"id":"618c611a_f09c770c","line":123,"range":{"start_line":123,"start_character":16,"end_line":123,"end_character":73},"updated":"2024-02-27 11:25:44.000000000","message":"do you need to set image.status \u003d \u0027queued\u0027 before this line?","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"caf297980a7b82c02e161cef95a3037a4fd028f2","unresolved":true,"context_lines":[{"line_number":120,"context_line":"            if image.locations:"},{"line_number":121,"context_line":"                image.locations.pop()"},{"line_number":122,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":123,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":46,"id":"8c3ce69a_a8a77349","line":123,"range":{"start_line":123,"start_character":16,"end_line":123,"end_character":73},"in_reply_to":"0657c619_efe8c498","updated":"2024-02-27 14:25:58.000000000","message":"In that case I am not seeing any use of this save call here. AFAIK you are setting image state to importing here, and if this task fails then image will remain in importing state itself.","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":true,"context_lines":[{"line_number":120,"context_line":"            if image.locations:"},{"line_number":121,"context_line":"                image.locations.pop()"},{"line_number":122,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":123,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":46,"id":"0657c619_efe8c498","line":123,"range":{"start_line":123,"start_character":16,"end_line":123,"end_character":73},"in_reply_to":"618c611a_f09c770c","updated":"2024-02-27 13:26:49.000000000","message":"No, image status would be either \u0027active\u0027 or \u0027importing\u0027 during CalculateHash execution and in revert we need to revert it from importing -\u003e queued if task fails(if validation_data is not None). \n\u0027active\u0027 to \u0027queued\u0027 is not allowed so if Validation_data is None and CalculateHash fails, we just need to pop out the os_hash_alsho value and location.","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a1550b911d439343a59f34bbf4119c853d8bf2e0","unresolved":false,"context_lines":[{"line_number":120,"context_line":"            if image.locations:"},{"line_number":121,"context_line":"                image.locations.pop()"},{"line_number":122,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027):"},{"line_number":123,"context_line":"                self.image_repo.save(image, from_state\u003dself.image_status)"},{"line_number":124,"context_line":"            else:"},{"line_number":125,"context_line":"                self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":46,"id":"86d82701_810f9470","line":123,"range":{"start_line":123,"start_character":16,"end_line":123,"end_character":73},"in_reply_to":"8c3ce69a_a8a77349","updated":"2024-02-27 15:27:48.000000000","message":"Done","commit_id":"9196c0654b7ed2c9deccb748dfa961c137bbeb77"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d3c74883f14e2c62aefc66e2bc68e7ec3206f1c7","unresolved":true,"context_lines":[{"line_number":114,"context_line":"        \"\"\""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":117,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027 and image.locations:"},{"line_number":118,"context_line":"                image.locations.pop()"},{"line_number":119,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":120,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"}],"source_content_type":"text/x-python","patch_set":48,"id":"d09e3ae7_e789426d","line":117,"range":{"start_line":117,"start_character":43,"end_line":117,"end_character":63},"updated":"2024-02-27 17:39:23.000000000","message":"nit: I doubt this is required, image state is importing means your UpdateLocationTask has already set the location to image.","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        \"\"\""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":117,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027 and image.locations:"},{"line_number":118,"context_line":"                image.locations.pop()"},{"line_number":119,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":120,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"}],"source_content_type":"text/x-python","patch_set":48,"id":"ecafb2a2_ae1970d5","line":117,"range":{"start_line":117,"start_character":43,"end_line":117,"end_character":63},"in_reply_to":"d09e3ae7_e789426d","updated":"2024-02-28 03:52:24.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":true,"context_lines":[{"line_number":160,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":161,"context_line":"            if image.locations:"},{"line_number":162,"context_line":"                image.locations.pop()"},{"line_number":163,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":164,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":165,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":166,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"}],"source_content_type":"text/x-python","patch_set":48,"id":"4524abf3_0177ee48","line":163,"range":{"start_line":163,"start_character":32,"end_line":163,"end_character":38},"updated":"2024-02-27 16:59:18.000000000","message":"Technically we don\u0027t even need to check that it is not queued :)","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[{"line_number":160,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":161,"context_line":"            if image.locations:"},{"line_number":162,"context_line":"                image.locations.pop()"},{"line_number":163,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":164,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":165,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":166,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"}],"source_content_type":"text/x-python","patch_set":48,"id":"ca7f2b5c_958d02ae","line":163,"range":{"start_line":163,"start_character":32,"end_line":163,"end_character":38},"in_reply_to":"4524abf3_0177ee48","updated":"2024-02-28 03:52:24.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":true,"context_lines":[{"line_number":164,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":165,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":166,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":167,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":168,"context_line":"            self.image_repo.save(image)"},{"line_number":169,"context_line":"        except exception.NotFound:"},{"line_number":170,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":48,"id":"d7209071_2b1c45e1","line":167,"range":{"start_line":167,"start_character":38,"end_line":167,"end_character":39},"updated":"2024-02-27 16:59:18.000000000","message":"Is it possible that the image variable does not have these three attributes here?","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"9db5b260adc311df5a0dcf251550b75eb3536e31","unresolved":false,"context_lines":[{"line_number":164,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":165,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":166,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":167,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":168,"context_line":"            self.image_repo.save(image)"},{"line_number":169,"context_line":"        except exception.NotFound:"},{"line_number":170,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":48,"id":"4090078f_8fa4e185","line":167,"range":{"start_line":167,"start_character":38,"end_line":167,"end_character":39},"in_reply_to":"1ce93a71_33215425","updated":"2024-02-29 10:17:58.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"d3c74883f14e2c62aefc66e2bc68e7ec3206f1c7","unresolved":true,"context_lines":[{"line_number":164,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":165,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":166,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":167,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":168,"context_line":"            self.image_repo.save(image)"},{"line_number":169,"context_line":"        except exception.NotFound:"},{"line_number":170,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":48,"id":"1ce93a71_33215425","line":167,"range":{"start_line":167,"start_character":38,"end_line":167,"end_character":39},"in_reply_to":"d7209071_2b1c45e1","updated":"2024-02-27 17:39:23.000000000","message":"No, we are setting it in CalculateHashTask which means they will be set to image already.","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":true,"context_lines":[{"line_number":202,"context_line":"        try:"},{"line_number":203,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":204,"context_line":"            if image.os_hash_algo:"},{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":48,"id":"1859bec1_8101c952","line":205,"range":{"start_line":205,"start_character":0,"end_line":205,"end_character":52},"updated":"2024-02-27 16:59:18.000000000","message":"So here, image does have an \u0027os_hash_algo\u0027 attribute, so using setattr is not necessary, and one would rather write \"image.os_hash_algo \u003d None\".","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        try:"},{"line_number":203,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":204,"context_line":"            if image.os_hash_algo:"},{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"}],"source_content_type":"text/x-python","patch_set":48,"id":"048039c4_e0d086dc","line":205,"range":{"start_line":205,"start_character":0,"end_line":205,"end_character":52},"in_reply_to":"1859bec1_8101c952","updated":"2024-02-28 03:52:24.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":true,"context_lines":[{"line_number":204,"context_line":"            if image.os_hash_algo:"},{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":209,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":210,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":48,"id":"5cd89fa1_82da3175","line":207,"range":{"start_line":207,"start_character":24,"end_line":207,"end_character":29},"updated":"2024-02-27 16:59:18.000000000","message":"Ditto","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            if image.os_hash_algo:"},{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":209,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":210,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":48,"id":"4974ec8c_2930c6cc","line":207,"range":{"start_line":207,"start_character":24,"end_line":207,"end_character":29},"in_reply_to":"5cd89fa1_82da3175","updated":"2024-02-28 03:52:24.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"d10ebf99f267a2d34b80fae38462c37eda3060c6","unresolved":true,"context_lines":[{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":209,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":210,"context_line":"            self.image_repo.save(image)"},{"line_number":211,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":48,"id":"0907bdbc_30f3a1a6","line":208,"range":{"start_line":208,"start_character":38,"end_line":208,"end_character":39},"updated":"2024-02-27 16:59:18.000000000","message":"We do not need to check this :)","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"943ddfe1fe8526858a11bda252e00c9ca20b1d78","unresolved":false,"context_lines":[{"line_number":205,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":206,"context_line":"            if image.os_hash_value:"},{"line_number":207,"context_line":"                setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":208,"context_line":"            if image.status !\u003d \u0027queued\u0027:"},{"line_number":209,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":210,"context_line":"            self.image_repo.save(image)"},{"line_number":211,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":48,"id":"2d1a1b6b_abf4fd32","line":208,"range":{"start_line":208,"start_character":38,"end_line":208,"end_character":39},"in_reply_to":"0907bdbc_30f3a1a6","updated":"2024-02-28 03:52:24.000000000","message":"Done","commit_id":"e008e27b6d51aa2d3487efcdd805fddf74a13c0c"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"6e2caeedaf8f9786111952ca147c6ae362b24244","unresolved":true,"context_lines":[{"line_number":238,"context_line":"            }"},{"line_number":239,"context_line":"            if CONF.enabled_backends:"},{"line_number":240,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":241,"context_line":"                    [updated_location])[0]"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            image.locations.append(updated_location)"},{"line_number":244,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":52,"id":"09a25398_08f80105","line":241,"range":{"start_line":241,"start_character":38,"end_line":241,"end_character":39},"updated":"2024-02-28 18:12:49.000000000","message":"we are not passing context here so the upload volume is failing async\n\nFeb 28 17:52:09.314295 np0036905625 devstack@g-api.service[87454]: WARNING glance.common.store_utils [-] Invalid location uri cinder://6758ba8c-d25a-4808-9df2-f0bfd5258d6b\n\nFeb 28 17:52:09.319198 np0036905625 devstack@g-api.service[87454]: WARNING glance.async_.taskflow_executor [-] Task \u0027location_import-UpdateLocationTask-f714d5c2-7e46-4ead-b77b-69fdd964cf47\u0027 (56850772-b587-46c6-b450-fb5959685568) transitioned into state \u0027FAILURE\u0027 from state \u0027RUNNING\u0027","commit_id":"e5dd051ff8fb8704238620c53000a8153300b415"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d5c061ec23dac836db0bd7bebf1c030d467804db","unresolved":true,"context_lines":[{"line_number":238,"context_line":"            }"},{"line_number":239,"context_line":"            if CONF.enabled_backends:"},{"line_number":240,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":241,"context_line":"                    [updated_location])[0]"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            image.locations.append(updated_location)"},{"line_number":244,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":52,"id":"c7d57073_458e2e7c","line":241,"range":{"start_line":241,"start_character":38,"end_line":241,"end_character":39},"in_reply_to":"09a25398_08f80105","updated":"2024-02-28 19:04:39.000000000","message":"Since I had isolated the url compatibility earlier, had to remove it from here. Now rebased that patch and readded this change as per the discussion.","commit_id":"e5dd051ff8fb8704238620c53000a8153300b415"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ac8efdeff17af0240a9b7443d93d035715d8b162","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            }"},{"line_number":239,"context_line":"            if CONF.enabled_backends:"},{"line_number":240,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":241,"context_line":"                    [updated_location])[0]"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            image.locations.append(updated_location)"},{"line_number":244,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":52,"id":"0d82d85f_172e33cf","line":241,"range":{"start_line":241,"start_character":38,"end_line":241,"end_character":39},"in_reply_to":"c7d57073_458e2e7c","updated":"2024-02-28 19:29:32.000000000","message":"Done","commit_id":"e5dd051ff8fb8704238620c53000a8153300b415"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"96b662595c4d6e4259e13a76a7018f990f17656d","unresolved":true,"context_lines":[{"line_number":77,"context_line":"            msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":78,"context_line":"                   {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":79,"context_line":"            LOG.debug(msg)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"},{"line_number":83,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"}],"source_content_type":"text/x-python","patch_set":54,"id":"d72a723f_f7cef69a","line":80,"updated":"2024-02-28 22:46:38.000000000","message":"This is a really confusing way to manage these retries. It would be much better to put the loop at the top (of the call stack) and run it from n..$retries until it succeeds. Doing things like this leads to bugs, like you\u0027ve got here.\n\nYou call this the first time with zero. It fails with IOError, so it calls the retry function, which loops through CONF.http_retries with retries\u003d1 calling back here each time. We fail again, so each of those times through the loop, we re-run the loop with N-1. What you end up with is 2^N retries instead of N.\n\nYou don\u0027t see this because you\u0027re mocking out the meat of this in your test. I wrote you another test that shows the problem:\n\n```\n    def test_retry_count(self):\n        repo \u003d mock.MagicMock()\n        flow \u003d import_flow._CalculateHash(None, None, repo, \u0027123\u0027,\n                                          CONF.hashing_algorithm, None)\n        image \u003d mock.MagicMock()\n        image.checksum \u003d None\n        image.get_data.side_effect \u003d IOError\n        self.config(http_retries\u003d\u002710\u0027)\n        flow._set_checksum_and_hash(image, 0)\n        self.assertEqual(CONF.http_retries, image.get_data.call_count)\n```\n\nIf you run it, you get this:\n```\ntesttools.matchers._impl.MismatchError: 10 !\u003d 1024\n```","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"9db5b260adc311df5a0dcf251550b75eb3536e31","unresolved":false,"context_lines":[{"line_number":77,"context_line":"            msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":78,"context_line":"                   {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":79,"context_line":"            LOG.debug(msg)"},{"line_number":80,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":81,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":82,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"},{"line_number":83,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"}],"source_content_type":"text/x-python","patch_set":54,"id":"dc1a319a_7a0db6b1","line":80,"in_reply_to":"d72a723f_f7cef69a","updated":"2024-02-29 10:17:58.000000000","message":"Done","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"ac8efdeff17af0240a9b7443d93d035715d8b162","unresolved":false,"context_lines":[{"line_number":238,"context_line":"            }"},{"line_number":239,"context_line":"            if CONF.enabled_backends:"},{"line_number":240,"context_line":"                updated_location \u003d store_utils.get_updated_store_location("},{"line_number":241,"context_line":"                    [updated_location], context\u003dself.context)[0]"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"            image.locations.append(updated_location)"},{"line_number":244,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":54,"id":"dd67ce58_2153c683","line":241,"range":{"start_line":241,"start_character":40,"end_line":241,"end_character":60},"updated":"2024-02-28 19:29:32.000000000","message":"this should fix the cinder upload volume issue","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"960839f3b3c64e9b93bae2526e364d7c5abbf1b9","unresolved":true,"context_lines":[{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retries\u003d1):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(self.hashing_algo)"},{"line_number":66,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":67,"context_line":"        if image.os_hash_algo is None:"},{"line_number":68,"context_line":"            image.os_hash_algo \u003d self.hashing_algo"},{"line_number":69,"context_line":"        try:"},{"line_number":70,"context_line":"            for chunk in image.get_data():"},{"line_number":71,"context_line":"                if chunk is None:"}],"source_content_type":"text/x-python","patch_set":55,"id":"bd2324bd_fb8e2eb4","line":68,"range":{"start_line":67,"start_character":8,"end_line":68,"end_character":50},"updated":"2024-02-29 10:43:27.000000000","message":"You should set in execute method only.","commit_id":"dac3c9ca8b462823107e32c201b1a5f33fdacf8a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"73fc45d41ad832754e28ff23fddf18b95c15310d","unresolved":false,"context_lines":[{"line_number":64,"context_line":"    def _set_checksum_and_hash(self, image, retries\u003d1):"},{"line_number":65,"context_line":"        current_os_hash_value \u003d hashlib.new(self.hashing_algo)"},{"line_number":66,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":67,"context_line":"        if image.os_hash_algo is None:"},{"line_number":68,"context_line":"            image.os_hash_algo \u003d self.hashing_algo"},{"line_number":69,"context_line":"        try:"},{"line_number":70,"context_line":"            for chunk in image.get_data():"},{"line_number":71,"context_line":"                if chunk is None:"}],"source_content_type":"text/x-python","patch_set":55,"id":"d5cf91a3_82485729","line":68,"range":{"start_line":67,"start_character":8,"end_line":68,"end_character":50},"in_reply_to":"bd2324bd_fb8e2eb4","updated":"2024-02-29 11:03:37.000000000","message":"Done","commit_id":"dac3c9ca8b462823107e32c201b1a5f33fdacf8a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"960839f3b3c64e9b93bae2526e364d7c5abbf1b9","unresolved":true,"context_lines":[{"line_number":79,"context_line":"            msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":80,"context_line":"                   {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":81,"context_line":"            LOG.debug(msg)"},{"line_number":82,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":83,"context_line":"            self.image_repo.save(image)"},{"line_number":84,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":85,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":86,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"}],"source_content_type":"text/x-python","patch_set":55,"id":"380a6224_0a1ebe34","line":83,"range":{"start_line":82,"start_character":12,"end_line":83,"end_character":39},"updated":"2024-02-29 10:43:27.000000000","message":"This should be popped only after all retries are executed and fails.","commit_id":"dac3c9ca8b462823107e32c201b1a5f33fdacf8a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"73fc45d41ad832754e28ff23fddf18b95c15310d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"            msg \u003d (_(\u0027Hash calculation failed due to %(exc)s\u0027) %"},{"line_number":80,"context_line":"                   {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":81,"context_line":"            LOG.debug(msg)"},{"line_number":82,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":83,"context_line":"            self.image_repo.save(image)"},{"line_number":84,"context_line":"            self._retry_hash_calculation(image, retries)"},{"line_number":85,"context_line":"            LOG.debug(_(\u0027Hash calculation failed for image after retrying\u0027"},{"line_number":86,"context_line":"                        \u0027 %(retry)s times\u0027), {\u0027retry\u0027: retries})"}],"source_content_type":"text/x-python","patch_set":55,"id":"68c55711_6c93b7c1","line":83,"range":{"start_line":82,"start_character":12,"end_line":83,"end_character":39},"in_reply_to":"380a6224_0a1ebe34","updated":"2024-02-29 11:03:37.000000000","message":"Done","commit_id":"dac3c9ca8b462823107e32c201b1a5f33fdacf8a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"efdfda7a43cb9779d0d414265f6cb7b280e5e2ac","unresolved":true,"context_lines":[{"line_number":54,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":55,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":58,"context_line":"        LOG.debug(\"Retrying hash and checksum calculation for \u0027%s\u0027 time\","},{"line_number":59,"context_line":"                  retries)"},{"line_number":60,"context_line":"        if image.checksum is None and retries \u003c CONF.http_retries:"}],"source_content_type":"text/x-python","patch_set":56,"id":"bcedc451_bdcab26b","line":57,"updated":"2024-02-29 15:31:47.000000000","message":"I really think this retry mechanism needs to be completely redone, and you should not just try to patch it up to avoid the exponential recursion. Especially with the pressure being off for merging today, it\u0027s time to rewrite this part, IMHO. Putting the recursive retry loop in the error handler is just *asking* for problems.","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c804e6db3659d5ea4056307c07bcf54ce9ddd8e6","unresolved":true,"context_lines":[{"line_number":54,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":55,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":58,"context_line":"        LOG.debug(\"Retrying hash and checksum calculation for \u0027%s\u0027 time\","},{"line_number":59,"context_line":"                  retries)"},{"line_number":60,"context_line":"        if image.checksum is None and retries \u003c CONF.http_retries:"}],"source_content_type":"text/x-python","patch_set":56,"id":"438444e1_e80b047d","line":57,"in_reply_to":"0147e7e3_5de80144","updated":"2024-04-04 14:39:08.000000000","message":"ohh sure! I had got this suggestion of using this retry mechanism earlier [1], so thought to give it a try.\n\n[1] : https://review.opendev.org/c/openstack/glance/+/886749/9..57/glance/async_/flows/location_import.py#b93","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5f6a2000c55dd17daad481ce515062dd6703118e","unresolved":true,"context_lines":[{"line_number":54,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":55,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":58,"context_line":"        LOG.debug(\"Retrying hash and checksum calculation for \u0027%s\u0027 time\","},{"line_number":59,"context_line":"                  retries)"},{"line_number":60,"context_line":"        if image.checksum is None and retries \u003c CONF.http_retries:"}],"source_content_type":"text/x-python","patch_set":56,"id":"0147e7e3_5de80144","line":57,"in_reply_to":"1bece740_62a4c9ec","updated":"2024-04-04 13:46:43.000000000","message":"I don\u0027t think that\u0027s a good solution because it\u0027s too heavyweight. It\u0027s really not hard to implement a simple and straightforward retry loop ourselves. Just avoid the recursion and special cases and it will be fine. Something like:\n```\nhash \u003d None\nfor retry in range(1, retries + 1):\n    try:\n        hash \u003d calculate_hash(...)\n        break\n    except IOError:\n        LOG.warning(\u0027Failed hash calculation %i retries left\u0027,\n                    retries - retry)\n    except NotFound:\n        LOG.warning(\u0027Image was deleted\u0027)\n        image.delete()\n        image_repo.remove()\n        return\n\nimage.os_hash_algo \u003d hash\nimage_repo.save()\n   \n```\n\nor if you prefer a different style:\n\n````\nretries \u003d 5\nhash \u003d None\nwhile retries \u003e 0 and hash is None:\n    retries -\u003d 1\n    try:\n        hash \u003d calculate_hash(...)\n    except IOError:\n        LOG.warning(\u0027Failed hash calculation %i retries left\u0027,\n                    retries)\n    except NotFound:\n        LOG.warning(\u0027Image was deleted\u0027)\n        image.delete()\n        image_repo.remove()\n        return\n\nimage.os_hash_algo \u003d hash\nimage_repo.save()\n```","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5c88d40919cb95a9ef3a7f5c349cee1ebf3d9530","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":55,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":58,"context_line":"        LOG.debug(\"Retrying hash and checksum calculation for \u0027%s\u0027 time\","},{"line_number":59,"context_line":"                  retries)"},{"line_number":60,"context_line":"        if image.checksum is None and retries \u003c CONF.http_retries:"}],"source_content_type":"text/x-python","patch_set":56,"id":"c33278ad_e6ffd449","line":57,"in_reply_to":"438444e1_e80b047d","updated":"2024-04-08 06:33:40.000000000","message":"Done","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"708ab290cf07c0060646bfe7fbf41642d42fb9e1","unresolved":true,"context_lines":[{"line_number":54,"context_line":"        super(_CalculateHash, self).__init__("},{"line_number":55,"context_line":"            name\u003d\u0027%s-CalculateHash-%s\u0027 % (task_type, task_id))"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _retry_hash_calculation(self, image, retries):"},{"line_number":58,"context_line":"        LOG.debug(\"Retrying hash and checksum calculation for \u0027%s\u0027 time\","},{"line_number":59,"context_line":"                  retries)"},{"line_number":60,"context_line":"        if image.checksum is None and retries \u003c CONF.http_retries:"}],"source_content_type":"text/x-python","patch_set":56,"id":"1bece740_62a4c9ec","line":57,"in_reply_to":"bcedc451_bdcab26b","updated":"2024-04-04 07:01:10.000000000","message":"I\u0027m removing this retry logic and instead tried using the different retry mechanism with existing Times class from taskflow package[1] which retries the subflow given number of times. But it reverts the task after every failure which i think would be ok since we are setting the os_hash_algo and status to the image. Let me know your opinion on using this. \n\n[1]: https://github.com/openstack/taskflow/blob/master/taskflow/retry.py#L247","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"6ba00d902349719d46a3cc48bd81c65a1a2bd52a","unresolved":true,"context_lines":[{"line_number":300,"context_line":"        if val_data:"},{"line_number":301,"context_line":"            cal_hash_flow \u003d lf.Flow("},{"line_number":302,"context_line":"                \u0027hash-calculation\u0027,"},{"line_number":303,"context_line":"                retry\u003dretry.Times(CONF.http_retries)).add("},{"line_number":304,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":305,"context_line":"                               hashing_algo, status\u003d\u0027importing\u0027))"},{"line_number":306,"context_line":"            flow.add(cal_hash_flow,"}],"source_content_type":"text/x-python","patch_set":57,"id":"21d18c02_b8d3bdeb","line":303,"updated":"2024-04-04 09:06:55.000000000","message":"what happens if you pass revert_all\u003dTrue here along with retires?","commit_id":"8e945bbef169c16c5e2eaecc34e4caea00ccf530"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"20fd01c789a91428ada86e9d258999a40a2993e0","unresolved":true,"context_lines":[{"line_number":300,"context_line":"        if val_data:"},{"line_number":301,"context_line":"            cal_hash_flow \u003d lf.Flow("},{"line_number":302,"context_line":"                \u0027hash-calculation\u0027,"},{"line_number":303,"context_line":"                retry\u003dretry.Times(CONF.http_retries)).add("},{"line_number":304,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":305,"context_line":"                               hashing_algo, status\u003d\u0027importing\u0027))"},{"line_number":306,"context_line":"            flow.add(cal_hash_flow,"}],"source_content_type":"text/x-python","patch_set":57,"id":"3ffbede9_af673b2c","line":303,"in_reply_to":"21d18c02_b8d3bdeb","updated":"2024-04-04 10:33:55.000000000","message":"yeah I tried that too, it also reverts this task after each retry failure and at the end, reverts other tasks as well. Incase of val_data \u003d None, since we are setting image to \u0027active\u0027 before hash calculation, revert of SetImageToActiveTask also fails while changing the status if revert_all\u003dTrue.","commit_id":"8e945bbef169c16c5e2eaecc34e4caea00ccf530"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5c88d40919cb95a9ef3a7f5c349cee1ebf3d9530","unresolved":false,"context_lines":[{"line_number":300,"context_line":"        if val_data:"},{"line_number":301,"context_line":"            cal_hash_flow \u003d lf.Flow("},{"line_number":302,"context_line":"                \u0027hash-calculation\u0027,"},{"line_number":303,"context_line":"                retry\u003dretry.Times(CONF.http_retries)).add("},{"line_number":304,"context_line":"                _CalculateHash(task_id, task_type, image_repo, image_id,"},{"line_number":305,"context_line":"                               hashing_algo, status\u003d\u0027importing\u0027))"},{"line_number":306,"context_line":"            flow.add(cal_hash_flow,"}],"source_content_type":"text/x-python","patch_set":57,"id":"cd63db75_18850f7d","line":303,"in_reply_to":"3ffbede9_af673b2c","updated":"2024-04-08 06:33:40.000000000","message":"Done","commit_id":"8e945bbef169c16c5e2eaecc34e4caea00ccf530"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9240f86017848531b99f3c527c6cd8e53e878783","unresolved":true,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _set_checksum_and_hash(self, image):"},{"line_number":58,"context_line":"        current_os_hash_value \u003d hashlib.new(self.hashing_algo)"},{"line_number":59,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":60,"context_line":"        retries \u003d CONF.http_retries"},{"line_number":61,"context_line":"        while retries \u003e 0 and image.os_hash_value is None:"},{"line_number":62,"context_line":"            retries -\u003d 1"}],"source_content_type":"text/x-python","patch_set":58,"id":"cd42b69a_d7f6c3c8","line":59,"updated":"2024-04-23 14:16:05.000000000","message":"Both of these checksums will be wrong if we retry one or more times, right? Since you\u0027re not re-initializing them at the start of each retry loop, they\u0027re already populated with hash values from whatever portion of the image has been read so far when you go back to the beginning and start reading during the retry.\n\nIMHO, it would be better if you put the meat of one attempt into a method, and then call that method from inside the retry loop until it succeeds or we run out of retries (as in the example code I provided).","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"82835a458a4574548f4c0bc37395965caf76528a","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _set_checksum_and_hash(self, image):"},{"line_number":58,"context_line":"        current_os_hash_value \u003d hashlib.new(self.hashing_algo)"},{"line_number":59,"context_line":"        current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":60,"context_line":"        retries \u003d CONF.http_retries"},{"line_number":61,"context_line":"        while retries \u003e 0 and image.os_hash_value is None:"},{"line_number":62,"context_line":"            retries -\u003d 1"}],"source_content_type":"text/x-python","patch_set":58,"id":"82855a3a_965e2163","line":59,"in_reply_to":"cd42b69a_d7f6c3c8","updated":"2024-04-29 08:05:40.000000000","message":"Done","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9240f86017848531b99f3c527c6cd8e53e878783","unresolved":true,"context_lines":[{"line_number":74,"context_line":"                       {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":75,"context_line":"                LOG.debug(msg)"},{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":58,"id":"617212f8_eba1fff3","line":77,"updated":"2024-04-23 14:16:05.000000000","message":"This is a nit, but I would just put the retry counter in the first log message. Emitting two log lines for a single issue is not ideal, IMHO. Something like this would work:\n```\nLOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,\n          retry, limit, exc)\n```\nAlso it probably should be at least INFO level, IMHO.","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"82835a458a4574548f4c0bc37395965caf76528a","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                       {\u0027exc\u0027: encodeutils.exception_to_unicode(e)})"},{"line_number":75,"context_line":"                LOG.debug(msg)"},{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":58,"id":"9f284595_d9a2e7dc","line":77,"in_reply_to":"617212f8_eba1fff3","updated":"2024-04-29 08:05:40.000000000","message":"Acknowledged","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9240f86017848531b99f3c527c6cd8e53e878783","unresolved":true,"context_lines":[{"line_number":75,"context_line":"                LOG.debug(msg)"},{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"},{"line_number":81,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"}],"source_content_type":"text/x-python","patch_set":58,"id":"49f7b490_a672a302","line":78,"updated":"2024-04-23 14:16:05.000000000","message":"Why are you setting this to None here? If you have to retry once, won\u0027t this always remain None?\n\nAlso, why are you using setattr instead of just:\n```\nimage.os_hash_algo \u003d None\n```\n?","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"82835a458a4574548f4c0bc37395965caf76528a","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                LOG.debug(msg)"},{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"},{"line_number":81,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"}],"source_content_type":"text/x-python","patch_set":58,"id":"8c990287_ab003dd2","line":78,"in_reply_to":"49f7b490_a672a302","updated":"2024-04-29 08:05:40.000000000","message":"Done","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9240f86017848531b99f3c527c6cd8e53e878783","unresolved":true,"context_lines":[{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"},{"line_number":81,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":82,"context_line":"                # when hash calculation is ongoing, which deletes the image"}],"source_content_type":"text/x-python","patch_set":58,"id":"ea25c23d_fba5bf39","line":79,"updated":"2024-04-23 14:16:05.000000000","message":"Why save this every time through the loop? Seems like we should have one save as we leave the method, and then we can avoid the extra DB traffic each time we retry.\n\nAlso, where is the raise if we run out of retries? It seems to me that if we run out of retries, we will just fall out of this method (with os_hash_algo\u003dNone) and not call revert(), right?","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"82835a458a4574548f4c0bc37395965caf76528a","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                LOG.debug(\u0027Failed Hash Calculation %s retries left\u0027,"},{"line_number":77,"context_line":"                          retries)"},{"line_number":78,"context_line":"                setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":79,"context_line":"                self.image_repo.save(image)"},{"line_number":80,"context_line":"            except store.exceptions.NotFound:"},{"line_number":81,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":82,"context_line":"                # when hash calculation is ongoing, which deletes the image"}],"source_content_type":"text/x-python","patch_set":58,"id":"977c30c8_da2bb601","line":79,"in_reply_to":"ea25c23d_fba5bf39","updated":"2024-04-29 08:05:40.000000000","message":"Acknowledged","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e67635a9b4d8898499e581be0f44f799bff54cf6","unresolved":true,"context_lines":[{"line_number":121,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":122,"context_line":"                image.locations.pop()"},{"line_number":123,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":124,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"7688bc69_ba0349cd","line":124,"updated":"2024-04-29 18:15:28.000000000","message":"I\u0027ll ask again: why are you using `setattr()` here instead of just setting the attribute?","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d9118ff9872a761ceb9c44b931cab145db0b3e71","unresolved":true,"context_lines":[{"line_number":121,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":122,"context_line":"                image.locations.pop()"},{"line_number":123,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":124,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"d6067441_56b32e1e","line":124,"in_reply_to":"7688bc69_ba0349cd","updated":"2024-04-30 09:26:19.000000000","message":"I dont excatly remember why i decided to use this since there are lot of design changes happend so far and moved code from here and there and i missed to change it to regular assignment. It\u0027s not required here now since we are not setting os_hash_algo for the first time.","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d0722dd8a229e15f7f8d6e909a3d173812d01a85","unresolved":false,"context_lines":[{"line_number":121,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":122,"context_line":"                image.locations.pop()"},{"line_number":123,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":124,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":125,"context_line":"            self.image_repo.save(image)"},{"line_number":126,"context_line":"        except exception.NotFound:"},{"line_number":127,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"039559a3_8ff4b517","line":124,"in_reply_to":"d6067441_56b32e1e","updated":"2024-06-06 06:48:24.000000000","message":"Done","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e67635a9b4d8898499e581be0f44f799bff54cf6","unresolved":true,"context_lines":[{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":152,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("}],"source_content_type":"text/x-python","patch_set":59,"id":"7e5dcd61_3e6e95b9","line":151,"updated":"2024-04-29 18:15:28.000000000","message":"And here, why `getattr`?","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d9118ff9872a761ceb9c44b931cab145db0b3e71","unresolved":true,"context_lines":[{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":152,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("}],"source_content_type":"text/x-python","patch_set":59,"id":"85085f60_7cebb50b","line":151,"in_reply_to":"7e5dcd61_3e6e95b9","updated":"2024-04-30 09:26:19.000000000","message":"yeah it\u0027s not now required, I think may be earlier I was using this when as per old spec checksum and os_hash_value were being passed to validation data and incase of hashcalulation failure when these values were not set(and exception was not raised after hash failure) AttributeError was getting raised here.","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d9118ff9872a761ceb9c44b931cab145db0b3e71","unresolved":true,"context_lines":[{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":152,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("}],"source_content_type":"text/x-python","patch_set":59,"id":"20a225b6_43ab21a6","line":151,"in_reply_to":"7e5dcd61_3e6e95b9","updated":"2024-04-30 09:26:19.000000000","message":"yeah it\u0027s not required here since now this task will be executed after calculate hash only and os_hash_value will","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d0722dd8a229e15f7f8d6e909a3d173812d01a85","unresolved":false,"context_lines":[{"line_number":148,"context_line":"        \"\"\""},{"line_number":149,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d getattr("},{"line_number":152,"context_line":"                image, \u0027os_hash_value\u0027):"},{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("}],"source_content_type":"text/x-python","patch_set":59,"id":"24593161_4dd56efd","line":151,"in_reply_to":"85085f60_7cebb50b","updated":"2024-06-06 06:48:24.000000000","message":"Done","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e67635a9b4d8898499e581be0f44f799bff54cf6","unresolved":true,"context_lines":[{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":155,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":156,"context_line":"                   getattr(image, \u0027os_hash_value\u0027)))"},{"line_number":157,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":59,"id":"41a4a353_43535d31","line":156,"updated":"2024-04-29 18:15:28.000000000","message":"Also here.","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d9118ff9872a761ceb9c44b931cab145db0b3e71","unresolved":true,"context_lines":[{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":155,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":156,"context_line":"                   getattr(image, \u0027os_hash_value\u0027)))"},{"line_number":157,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":59,"id":"a8386489_302ad63d","line":156,"in_reply_to":"41a4a353_43535d31","updated":"2024-04-30 09:26:19.000000000","message":"ditto","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d0722dd8a229e15f7f8d6e909a3d173812d01a85","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":154,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":155,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":156,"context_line":"                   getattr(image, \u0027os_hash_value\u0027)))"},{"line_number":157,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":59,"id":"d433e890_8587e005","line":156,"in_reply_to":"a8386489_302ad63d","updated":"2024-06-06 06:48:24.000000000","message":"Done","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e67635a9b4d8898499e581be0f44f799bff54cf6","unresolved":true,"context_lines":[{"line_number":167,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":168,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":169,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":170,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":171,"context_line":"            self.image_repo.save(image)"},{"line_number":172,"context_line":"        except exception.NotFound:"},{"line_number":173,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"70281bf3_fbc7a370","line":170,"updated":"2024-04-29 18:15:28.000000000","message":"And all these.","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d9118ff9872a761ceb9c44b931cab145db0b3e71","unresolved":true,"context_lines":[{"line_number":167,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":168,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":169,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":170,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":171,"context_line":"            self.image_repo.save(image)"},{"line_number":172,"context_line":"        except exception.NotFound:"},{"line_number":173,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"df0f5480_d0b3679d","line":170,"in_reply_to":"70281bf3_fbc7a370","updated":"2024-04-30 09:26:19.000000000","message":"ditto","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d0722dd8a229e15f7f8d6e909a3d173812d01a85","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":168,"context_line":"            setattr(image, \u0027os_hash_algo\u0027, None)"},{"line_number":169,"context_line":"            setattr(image, \u0027os_hash_value\u0027, None)"},{"line_number":170,"context_line":"            setattr(image, \u0027checksum\u0027, None)"},{"line_number":171,"context_line":"            self.image_repo.save(image)"},{"line_number":172,"context_line":"        except exception.NotFound:"},{"line_number":173,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":59,"id":"5d5b98e5_8c53c8f3","line":170,"in_reply_to":"df0f5480_d0b3679d","updated":"2024-06-06 06:48:24.000000000","message":"Done","commit_id":"77c0060a08268d5660e7dd3325a938c1e1b93a29"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cac848a6a786d7c6f79aee8385bddad12251a70","unresolved":true,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":64,"id":"48b56254_9826ff54","line":32,"updated":"2024-06-14 06:07:40.000000000","message":"nit: I think you can delete these two lines","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f289a1b8c3f5feb178082470a11601d45e78f1e1","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"CONF \u003d cfg.CONF"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":64,"id":"1c1ec2fa_779dcc5f","line":32,"in_reply_to":"48b56254_9826ff54","updated":"2024-06-14 10:36:19.000000000","message":"Done","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cac848a6a786d7c6f79aee8385bddad12251a70","unresolved":true,"context_lines":[{"line_number":71,"context_line":"                          retries, CONF.http_retries,"},{"line_number":72,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":73,"context_line":"                if retries \u003d\u003d 0:"},{"line_number":74,"context_line":"                    image.os_hash_algo \u003d None"},{"line_number":75,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":76,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":77,"context_line":"                    raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":64,"id":"9bf0f86b_1c6d96f8","line":74,"range":{"start_line":74,"start_character":20,"end_line":74,"end_character":45},"updated":"2024-06-14 06:07:40.000000000","message":"I think this code is not tested, because you are setting it back to None but not calling image.save and raising the exception, so I doubt this will be set to None.\n\nAlso IMO this should be done in revert call, right?","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f289a1b8c3f5feb178082470a11601d45e78f1e1","unresolved":false,"context_lines":[{"line_number":71,"context_line":"                          retries, CONF.http_retries,"},{"line_number":72,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":73,"context_line":"                if retries \u003d\u003d 0:"},{"line_number":74,"context_line":"                    image.os_hash_algo \u003d None"},{"line_number":75,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":76,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":77,"context_line":"                    raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":64,"id":"c50c08bc_3aa0c344","line":74,"range":{"start_line":74,"start_character":20,"end_line":74,"end_character":45},"in_reply_to":"8d8e8040_1522fdeb","updated":"2024-06-14 10:36:19.000000000","message":"Done","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"af4c4167a00af56f57b907b0dca55d189cdebdab","unresolved":true,"context_lines":[{"line_number":71,"context_line":"                          retries, CONF.http_retries,"},{"line_number":72,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":73,"context_line":"                if retries \u003d\u003d 0:"},{"line_number":74,"context_line":"                    image.os_hash_algo \u003d None"},{"line_number":75,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":76,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":77,"context_line":"                    raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":64,"id":"8d8e8040_1522fdeb","line":74,"range":{"start_line":74,"start_character":20,"end_line":74,"end_character":45},"in_reply_to":"9bf0f86b_1c6d96f8","updated":"2024-06-14 08:01:58.000000000","message":"Yeah forgot to remove this, it\u0027s not required here anymore. In the revert call I\u0027m already setting it to None. Will remove it in updated PS.","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cac848a6a786d7c6f79aee8385bddad12251a70","unresolved":true,"context_lines":[{"line_number":90,"context_line":"                image.delete()"},{"line_number":91,"context_line":"                self.image_repo.remove(image)"},{"line_number":92,"context_line":"                return"},{"line_number":93,"context_line":"        self.image_repo.save(image)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def execute(self):"},{"line_number":96,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":64,"id":"fff732b1_c91e0479","line":93,"range":{"start_line":93,"start_character":8,"end_line":93,"end_character":35},"updated":"2024-06-14 06:07:40.000000000","message":"nit: If you move this line in try block then you can avoid return at line 92","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e6b8c077fb47a9d114a96855952ee05228435a72","unresolved":true,"context_lines":[{"line_number":90,"context_line":"                image.delete()"},{"line_number":91,"context_line":"                self.image_repo.remove(image)"},{"line_number":92,"context_line":"                return"},{"line_number":93,"context_line":"        self.image_repo.save(image)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def execute(self):"},{"line_number":96,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":64,"id":"fcf28e57_4e86a238","line":93,"range":{"start_line":93,"start_character":8,"end_line":93,"end_character":35},"in_reply_to":"6cb3c55d_1b0b750f","updated":"2024-06-14 08:21:39.000000000","message":"break is appropriate statement in that case. Also image_repo.remove call will save the deleted state of image.","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"f289a1b8c3f5feb178082470a11601d45e78f1e1","unresolved":false,"context_lines":[{"line_number":90,"context_line":"                image.delete()"},{"line_number":91,"context_line":"                self.image_repo.remove(image)"},{"line_number":92,"context_line":"                return"},{"line_number":93,"context_line":"        self.image_repo.save(image)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def execute(self):"},{"line_number":96,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":64,"id":"cc9eaa4e_0d511d48","line":93,"range":{"start_line":93,"start_character":8,"end_line":93,"end_character":35},"in_reply_to":"fcf28e57_4e86a238","updated":"2024-06-14 10:36:19.000000000","message":"Done","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"af4c4167a00af56f57b907b0dca55d189cdebdab","unresolved":true,"context_lines":[{"line_number":90,"context_line":"                image.delete()"},{"line_number":91,"context_line":"                self.image_repo.remove(image)"},{"line_number":92,"context_line":"                return"},{"line_number":93,"context_line":"        self.image_repo.save(image)"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    def execute(self):"},{"line_number":96,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":64,"id":"6cb3c55d_1b0b750f","line":93,"range":{"start_line":93,"start_character":8,"end_line":93,"end_character":35},"in_reply_to":"fff732b1_c91e0479","updated":"2024-06-14 08:01:58.000000000","message":"Since I\u0027m not raising the NotFound and deleting the image, that return is required to get out of while loop and then save the deleted state.\nAlso, image.os_hash_value is not getting saved until the hash calculation is successful hence I have kept is outside try block so that i can use that check in while condition for multiple retries.","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"902352e435b01a00a24790e47a92a9902c0fd346","unresolved":true,"context_lines":[{"line_number":192,"context_line":"                image.os_hash_algo \u003d None"},{"line_number":193,"context_line":"            if image.os_hash_value:"},{"line_number":194,"context_line":"                image.os_hash_value \u003d None"},{"line_number":195,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":196,"context_line":"            self.image_repo.save(image)"},{"line_number":197,"context_line":"        except exception.NotFound:"},{"line_number":198,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":66,"id":"d9c014c1_2e94961c","line":195,"range":{"start_line":195,"start_character":12,"end_line":195,"end_character":35},"updated":"2024-06-26 15:31:37.000000000","message":"The image state will be queued in this task so this line is not required.","commit_id":"81972790b30d01086357cef1608b64f83ff8b0f7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6195cad6338be89286280adbd20d118e1f11d98e","unresolved":false,"context_lines":[{"line_number":192,"context_line":"                image.os_hash_algo \u003d None"},{"line_number":193,"context_line":"            if image.os_hash_value:"},{"line_number":194,"context_line":"                image.os_hash_value \u003d None"},{"line_number":195,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":196,"context_line":"            self.image_repo.save(image)"},{"line_number":197,"context_line":"        except exception.NotFound:"},{"line_number":198,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":66,"id":"e9743fef_62e7c4c6","line":195,"range":{"start_line":195,"start_character":12,"end_line":195,"end_character":35},"in_reply_to":"d9c014c1_2e94961c","updated":"2024-06-28 12:47:26.000000000","message":"Done","commit_id":"81972790b30d01086357cef1608b64f83ff8b0f7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"902352e435b01a00a24790e47a92a9902c0fd346","unresolved":true,"context_lines":[{"line_number":263,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":264,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":265,"context_line":"                image.locations.pop()"},{"line_number":266,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027, \u0027deleted\u0027):"},{"line_number":267,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":268,"context_line":"            self.image_repo.save(image)"},{"line_number":269,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":66,"id":"bb5bf287_24a5ce16","line":266,"range":{"start_line":266,"start_character":12,"end_line":266,"end_character":67},"updated":"2024-06-26 15:31:37.000000000","message":"why not checking image.status \u003d\u003d importing?.","commit_id":"81972790b30d01086357cef1608b64f83ff8b0f7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6195cad6338be89286280adbd20d118e1f11d98e","unresolved":false,"context_lines":[{"line_number":263,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":264,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":265,"context_line":"                image.locations.pop()"},{"line_number":266,"context_line":"            if image.status not in (\u0027queued\u0027, \u0027active\u0027, \u0027deleted\u0027):"},{"line_number":267,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":268,"context_line":"            self.image_repo.save(image)"},{"line_number":269,"context_line":"        except exception.NotFound:"}],"source_content_type":"text/x-python","patch_set":66,"id":"7808102f_4e2ffa88","line":266,"range":{"start_line":266,"start_character":12,"end_line":266,"end_character":67},"in_reply_to":"bb5bf287_24a5ce16","updated":"2024-06-28 12:47:26.000000000","message":"Done","commit_id":"81972790b30d01086357cef1608b64f83ff8b0f7"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _set_checksum_and_hash(self, image):"},{"line_number":61,"context_line":"        retries \u003d CONF.http_retries"},{"line_number":62,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":63,"context_line":"        while retries \u003e 0 and image.os_hash_value is None:"},{"line_number":64,"context_line":"            retries -\u003d 1"},{"line_number":65,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":67,"id":"63305226_5f6a27f8","line":62,"range":{"start_line":62,"start_character":8,"end_line":62,"end_character":46},"updated":"2024-07-10 18:38:20.000000000","message":"you are not calling save after this, so os_hash_algo will not be set unless hash and checksum is calculated. This will be problematic to implement polling logic at consumer side.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def _set_checksum_and_hash(self, image):"},{"line_number":61,"context_line":"        retries \u003d CONF.http_retries"},{"line_number":62,"context_line":"        image.os_hash_algo \u003d self.hashing_algo"},{"line_number":63,"context_line":"        while retries \u003e 0 and image.os_hash_value is None:"},{"line_number":64,"context_line":"            retries -\u003d 1"},{"line_number":65,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":67,"id":"811c43bf_85993564","line":62,"range":{"start_line":62,"start_character":8,"end_line":62,"end_character":46},"in_reply_to":"63305226_5f6a27f8","updated":"2024-07-16 10:25:41.000000000","message":"Done","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"3bdf80771cb4ec9d9c3c947941f0488d51475be6","unresolved":true,"context_lines":[{"line_number":66,"context_line":"                utils.calculate_hash(image)"},{"line_number":67,"context_line":"                self.image_repo.save(image)"},{"line_number":68,"context_line":"            except IOError as e:"},{"line_number":69,"context_line":"                LOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,"},{"line_number":70,"context_line":"                          retries, CONF.http_retries,"},{"line_number":71,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":72,"context_line":"                if retries \u003d\u003d 0:"},{"line_number":73,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"}],"source_content_type":"text/x-python","patch_set":67,"id":"d16bea8e_b3d62cfe","line":70,"range":{"start_line":69,"start_character":16,"end_line":70,"end_character":53},"updated":"2024-07-15 08:14:42.000000000","message":"This logs like\n\n\n[4/5]\n[3/5]\n[2/5]\n[1/5]\n[0/5]\n\nwhere as it should start with [1/5] and ends with [5/5]","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":66,"context_line":"                utils.calculate_hash(image)"},{"line_number":67,"context_line":"                self.image_repo.save(image)"},{"line_number":68,"context_line":"            except IOError as e:"},{"line_number":69,"context_line":"                LOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,"},{"line_number":70,"context_line":"                          retries, CONF.http_retries,"},{"line_number":71,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":72,"context_line":"                if retries \u003d\u003d 0:"},{"line_number":73,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"}],"source_content_type":"text/x-python","patch_set":67,"id":"24a27eab_68089a4a","line":70,"range":{"start_line":69,"start_character":16,"end_line":70,"end_character":53},"in_reply_to":"d16bea8e_b3d62cfe","updated":"2024-07-16 10:25:41.000000000","message":"Done","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":86,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"b242930e_38f113bb","line":89,"range":{"start_line":88,"start_character":16,"end_line":89,"end_character":45},"updated":"2024-07-10 18:38:20.000000000","message":"As discussed this should be handled in delete API flow (location.py delete method)","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"94cb6eafd8b2a091dc271e461c28199d3cef60c7","unresolved":true,"context_lines":[{"line_number":85,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":86,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"f33ced16_964395c8","line":89,"range":{"start_line":88,"start_character":16,"end_line":89,"end_character":45},"in_reply_to":"b242930e_38f113bb","updated":"2024-07-12 07:53:08.000000000","message":"This might not required to move if we add wait logic in tempest test","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":85,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":86,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"}],"source_content_type":"text/x-python","patch_set":67,"id":"52aa4490_60d5dc4b","line":89,"range":{"start_line":88,"start_character":16,"end_line":89,"end_character":45},"in_reply_to":"f33ced16_964395c8","updated":"2024-07-16 10:25:41.000000000","message":"Acknowledged","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"},{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":67,"id":"e43d2bab_5a957403","line":90,"range":{"start_line":90,"start_character":16,"end_line":90,"end_character":21},"updated":"2024-07-10 18:38:20.000000000","message":"Also instead of break this should be raised otherwise this task will be marked as successful and image will have hash_algo set but not hash values and then polling logic can break at consumers side.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"},{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":67,"id":"23e30cca_e47f889e","line":90,"range":{"start_line":90,"start_character":16,"end_line":90,"end_character":21},"in_reply_to":"51e50324_7949406f","updated":"2024-07-16 10:25:41.000000000","message":"Done","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"94cb6eafd8b2a091dc271e461c28199d3cef60c7","unresolved":true,"context_lines":[{"line_number":87,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":88,"context_line":"                image.delete()"},{"line_number":89,"context_line":"                self.image_repo.remove(image)"},{"line_number":90,"context_line":"                break"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    def execute(self):"},{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"}],"source_content_type":"text/x-python","patch_set":67,"id":"51e50324_7949406f","line":90,"range":{"start_line":90,"start_character":16,"end_line":90,"end_character":21},"in_reply_to":"e43d2bab_5a957403","updated":"2024-07-12 07:53:08.000000000","message":"This will also not required as the wait logic at tempest will look for success task state and if we raise here it will mark the task as failed.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":94,"context_line":"        if image.status \u003d\u003d \u0027queued\u0027:"},{"line_number":95,"context_line":"            image.status \u003d self.image_status"},{"line_number":96,"context_line":"        self.image_repo.save(image)"},{"line_number":97,"context_line":"        self._set_checksum_and_hash(image)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":67,"id":"529e14b4_2c288572","line":96,"updated":"2024-07-10 18:38:20.000000000","message":"I think better you should set hash algo before this save call.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":94,"context_line":"        if image.status \u003d\u003d \u0027queued\u0027:"},{"line_number":95,"context_line":"            image.status \u003d self.image_status"},{"line_number":96,"context_line":"        self.image_repo.save(image)"},{"line_number":97,"context_line":"        self._set_checksum_and_hash(image)"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def revert(self, result, **kwargs):"}],"source_content_type":"text/x-python","patch_set":67,"id":"430a9361_725b2235","line":96,"in_reply_to":"529e14b4_2c288572","updated":"2024-07-16 10:25:41.000000000","message":"Done","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":262,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":263,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":264,"context_line":"                image.locations.pop()"},{"line_number":265,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":266,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":267,"context_line":"            self.image_repo.save(image)"},{"line_number":268,"context_line":"        except exception.NotFound:"},{"line_number":269,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":67,"id":"e8dd2a87_bb3b6edc","line":266,"range":{"start_line":265,"start_character":12,"end_line":266,"end_character":39},"updated":"2024-07-10 18:38:20.000000000","message":"I think this should be an inner loop","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":262,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":263,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":264,"context_line":"                image.locations.pop()"},{"line_number":265,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":266,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":267,"context_line":"            self.image_repo.save(image)"},{"line_number":268,"context_line":"        except exception.NotFound:"},{"line_number":269,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":67,"id":"ae5cff12_77353e65","line":266,"range":{"start_line":265,"start_character":12,"end_line":266,"end_character":39},"in_reply_to":"a04869a0_17521bcb","updated":"2024-07-16 10:25:41.000000000","message":"Acknowledged","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"40ca24d85cf81ce5eb7b2cc2e18450d2ad326be1","unresolved":true,"context_lines":[{"line_number":262,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":263,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":264,"context_line":"                image.locations.pop()"},{"line_number":265,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":266,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":267,"context_line":"            self.image_repo.save(image)"},{"line_number":268,"context_line":"        except exception.NotFound:"},{"line_number":269,"context_line":"            LOG.debug(\"Image %s might have been deleted from the backend\","}],"source_content_type":"text/x-python","patch_set":67,"id":"a04869a0_17521bcb","line":266,"range":{"start_line":265,"start_character":12,"end_line":266,"end_character":39},"in_reply_to":"e8dd2a87_bb3b6edc","updated":"2024-07-15 06:46:58.000000000","message":"you can have this inside if after line 264 and 266 as well","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b34350d202abbf86ce1b93a615068d087385e1ea","unresolved":true,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    # Instantiate an action wrapper with the admin repo if we got one,"},{"line_number":296,"context_line":"    # otherwise with the regular repo."},{"line_number":297,"context_line":"    action_wrapper \u003d image_import.ImportActionWrapper("},{"line_number":298,"context_line":"        admin_repo or image_repo, image_id, task_id)"},{"line_number":299,"context_line":"    kwargs[\u0027action_wrapper\u0027] \u003d action_wrapper"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"03a8e55c_e3f2741f","line":297,"updated":"2024-06-28 15:41:54.000000000","message":"Sorry I realised it very late, but why you are not using action_wrapper in your task to save image state, I guess you can add attributes here [1] to use action wrapper to set checksum, os_hash_algo and os_hash_value as well.\n\n[1] https://github.com/openstack/glance/blob/master/glance/async_/flows/api_image_import.py#L357","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c0a352e8c3001af0071c817b166373f3e774cc70","unresolved":true,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    # Instantiate an action wrapper with the admin repo if we got one,"},{"line_number":296,"context_line":"    # otherwise with the regular repo."},{"line_number":297,"context_line":"    action_wrapper \u003d image_import.ImportActionWrapper("},{"line_number":298,"context_line":"        admin_repo or image_repo, image_id, task_id)"},{"line_number":299,"context_line":"    kwargs[\u0027action_wrapper\u0027] \u003d action_wrapper"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"2bf9d479_a4bfbba7","line":297,"in_reply_to":"03a8e55c_e3f2741f","updated":"2024-07-01 14:28:30.000000000","message":"Well, there no specific reason for not using the action_wrapper.\nShould I use that for image status ? because after moving the calculate hash part to utils we can\u0027t use action_wrapper to set those values here right (may be just for hash_algo it can be used) and in SetHashValues task it would be helpful.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"5b4dfdd1c8c298f1b0ec66c749d6eaba48078c93","unresolved":true,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    # Instantiate an action wrapper with the admin repo if we got one,"},{"line_number":296,"context_line":"    # otherwise with the regular repo."},{"line_number":297,"context_line":"    action_wrapper \u003d image_import.ImportActionWrapper("},{"line_number":298,"context_line":"        admin_repo or image_repo, image_id, task_id)"},{"line_number":299,"context_line":"    kwargs[\u0027action_wrapper\u0027] \u003d action_wrapper"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"46a355c7_5457e519","line":297,"in_reply_to":"2bf9d479_a4bfbba7","updated":"2024-07-01 14:52:59.000000000","message":"You can pass action wrapper to utils as well, but let it be I don\u0027t have any strong objection, lets see what other cores think.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    # Instantiate an action wrapper with the admin repo if we got one,"},{"line_number":296,"context_line":"    # otherwise with the regular repo."},{"line_number":297,"context_line":"    action_wrapper \u003d image_import.ImportActionWrapper("},{"line_number":298,"context_line":"        admin_repo or image_repo, image_id, task_id)"},{"line_number":299,"context_line":"    kwargs[\u0027action_wrapper\u0027] \u003d action_wrapper"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"4b413bda_a8971188","line":297,"in_reply_to":"46a355c7_5457e519","updated":"2024-07-18 05:18:20.000000000","message":"Need to make this provision in followup patch.","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a8196cb3589ba10fd0658acf354bdef421ac91db","unresolved":false,"context_lines":[{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    # Instantiate an action wrapper with the admin repo if we got one,"},{"line_number":296,"context_line":"    # otherwise with the regular repo."},{"line_number":297,"context_line":"    action_wrapper \u003d image_import.ImportActionWrapper("},{"line_number":298,"context_line":"        admin_repo or image_repo, image_id, task_id)"},{"line_number":299,"context_line":"    kwargs[\u0027action_wrapper\u0027] \u003d action_wrapper"},{"line_number":300,"context_line":""}],"source_content_type":"text/x-python","patch_set":67,"id":"2e373f1f_aea47dd2","line":297,"in_reply_to":"4b413bda_a8971188","updated":"2024-07-25 06:56:38.000000000","message":"Acknowledged","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":74,"context_line":"        while retries \u003c\u003d CONF.http_retries and image.os_hash_value is None:"},{"line_number":75,"context_line":"            retries +\u003d 1"},{"line_number":76,"context_line":"            try:"},{"line_number":77,"context_line":"                self._calculate_hash(image)"},{"line_number":78,"context_line":"                self.image_repo.save(image)"},{"line_number":79,"context_line":"            except IOError as e:"},{"line_number":80,"context_line":"                LOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,"}],"source_content_type":"text/x-python","patch_set":69,"id":"cb54c365_e8e6f568","line":77,"range":{"start_line":77,"start_character":16,"end_line":77,"end_character":43},"updated":"2024-07-18 05:18:20.000000000","message":"nit: Don\u0027t see any advantage of making this method.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c1edd8c5dbd2c50f2b1f76c9b8bc5cb059dc5b0a","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        while retries \u003c\u003d CONF.http_retries and image.os_hash_value is None:"},{"line_number":75,"context_line":"            retries +\u003d 1"},{"line_number":76,"context_line":"            try:"},{"line_number":77,"context_line":"                self._calculate_hash(image)"},{"line_number":78,"context_line":"                self.image_repo.save(image)"},{"line_number":79,"context_line":"            except IOError as e:"},{"line_number":80,"context_line":"                LOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,"}],"source_content_type":"text/x-python","patch_set":69,"id":"9d8d5a88_d7e4cbbd","line":77,"range":{"start_line":77,"start_character":16,"end_line":77,"end_character":43},"in_reply_to":"a14169e6_1e97eb88","updated":"2024-07-22 07:46:52.000000000","message":"Acknowledged","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":true,"context_lines":[{"line_number":74,"context_line":"        while retries \u003c\u003d CONF.http_retries and image.os_hash_value is None:"},{"line_number":75,"context_line":"            retries +\u003d 1"},{"line_number":76,"context_line":"            try:"},{"line_number":77,"context_line":"                self._calculate_hash(image)"},{"line_number":78,"context_line":"                self.image_repo.save(image)"},{"line_number":79,"context_line":"            except IOError as e:"},{"line_number":80,"context_line":"                LOG.debug(\u0027[%i/%i] Hash calculation failed due to %s\u0027,"}],"source_content_type":"text/x-python","patch_set":69,"id":"a14169e6_1e97eb88","line":77,"range":{"start_line":77,"start_character":16,"end_line":77,"end_character":43},"in_reply_to":"cb54c365_e8e6f568","updated":"2024-07-22 07:24:31.000000000","message":"I separated out as per suggestion earlier [1]\n\n[1]: https://review.opendev.org/c/openstack/glance/+/886749/58..69/glance/async_/flows/location_import.py","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":81,"context_line":"                          retries, CONF.http_retries,"},{"line_number":82,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":69,"id":"48145715_f4e2e8b1","line":84,"range":{"start_line":84,"start_character":30,"end_line":84,"end_character":62},"updated":"2024-07-18 05:18:20.000000000","message":"Hash calculation failed for image %s","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                          retries, CONF.http_retries,"},{"line_number":82,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed on image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":69,"id":"ac28bdc9_c5f1dca5","line":84,"range":{"start_line":84,"start_character":30,"end_line":84,"end_character":62},"in_reply_to":"48145715_f4e2e8b1","updated":"2024-07-22 07:24:31.000000000","message":"Done","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"},{"line_number":88,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":89,"context_line":"                # when hash calculation is ongoing, which deletes the image"},{"line_number":90,"context_line":"                # data from backend(specially rbd) but image remains in"},{"line_number":91,"context_line":"                # \u0027active\u0027 state."},{"line_number":92,"context_line":"                # see: https://bugs.launchpad.net/glance/+bug/2045769"}],"source_content_type":"text/x-python","patch_set":69,"id":"0c3ff7ca_3a0c84d3","line":89,"range":{"start_line":89,"start_character":40,"end_line":89,"end_character":50},"updated":"2024-07-18 05:18:20.000000000","message":"is in progress,","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"},{"line_number":88,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":89,"context_line":"                # when hash calculation is ongoing, which deletes the image"},{"line_number":90,"context_line":"                # data from backend(specially rbd) but image remains in"},{"line_number":91,"context_line":"                # \u0027active\u0027 state."},{"line_number":92,"context_line":"                # see: https://bugs.launchpad.net/glance/+bug/2045769"}],"source_content_type":"text/x-python","patch_set":69,"id":"be6baffe_a0722b0a","line":89,"range":{"start_line":89,"start_character":40,"end_line":89,"end_character":50},"in_reply_to":"0c3ff7ca_3a0c84d3","updated":"2024-07-22 07:24:31.000000000","message":"Done","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"31fb8a45b80c885d99d416e810b8d2c704969971","unresolved":true,"context_lines":[{"line_number":146,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d image.os_hash_value:"},{"line_number":149,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":150,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":151,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":152,"context_line":"                   image.os_hash_value))"},{"line_number":153,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Set image status back to queued and"},{"line_number":157,"context_line":"           set the hash values to None"}],"source_content_type":"text/x-python","patch_set":69,"id":"0c84bc2e_835992d6","line":154,"range":{"start_line":149,"start_character":12,"end_line":154,"end_character":0},"updated":"2024-07-18 07:51:36.000000000","message":"In case of http store if bad value is passed for os_hash_value in validation data then task fails which is expected but it stores location of the image which is wrong, that needs to be popped.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":true,"context_lines":[{"line_number":146,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d image.os_hash_value:"},{"line_number":149,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":150,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":151,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":152,"context_line":"                   image.os_hash_value))"},{"line_number":153,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Set image status back to queued and"},{"line_number":157,"context_line":"           set the hash values to None"}],"source_content_type":"text/x-python","patch_set":69,"id":"1343c77f_2c6398c8","line":154,"range":{"start_line":149,"start_character":12,"end_line":154,"end_character":0},"in_reply_to":"0c84bc2e_835992d6","updated":"2024-07-22 07:24:31.000000000","message":"As per the discussion, since http store doesn\u0027t allow deletion we need to avoid validation data verification in case of http store. I will fix this in follow-up patch and modify the current reno as decided.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c1edd8c5dbd2c50f2b1f76c9b8bc5cb059dc5b0a","unresolved":false,"context_lines":[{"line_number":146,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        if self.val_data[\u0027os_hash_value\u0027] !\u003d image.os_hash_value:"},{"line_number":149,"context_line":"            msg \u003d (_(\"os_hash_value: (%s) not matched with actual \""},{"line_number":150,"context_line":"                     \"os_hash_value: (%s)\") % ("},{"line_number":151,"context_line":"                   self.val_data[\u0027os_hash_value\u0027],"},{"line_number":152,"context_line":"                   image.os_hash_value))"},{"line_number":153,"context_line":"            raise exception.InvalidParameterValue(msg)"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def revert(self, result, **kwargs):"},{"line_number":156,"context_line":"        \"\"\"Set image status back to queued and"},{"line_number":157,"context_line":"           set the hash values to None"}],"source_content_type":"text/x-python","patch_set":69,"id":"036203fc_376eb7dc","line":154,"range":{"start_line":149,"start_character":12,"end_line":154,"end_character":0},"in_reply_to":"1343c77f_2c6398c8","updated":"2024-07-22 07:46:52.000000000","message":"Acknowledged, don\u0027t forget to mention this issue in reno as well.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":161,"context_line":"            if image.locations:"},{"line_number":162,"context_line":"                image.locations.pop()"},{"line_number":163,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":164,"context_line":"            image.os_hash_algo \u003d None"}],"source_content_type":"text/x-python","patch_set":69,"id":"06dea9b4_91cfadc9","line":161,"range":{"start_line":161,"start_character":12,"end_line":161,"end_character":31},"updated":"2024-07-18 05:18:20.000000000","message":"I don\u0027t think this condition is required here, because image will have location at this point since your 2nd task UpdateLocation is adding location to image.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        \"\"\""},{"line_number":159,"context_line":"        try:"},{"line_number":160,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":161,"context_line":"            if image.locations:"},{"line_number":162,"context_line":"                image.locations.pop()"},{"line_number":163,"context_line":"            image.status \u003d \u0027queued\u0027"},{"line_number":164,"context_line":"            image.os_hash_algo \u003d None"}],"source_content_type":"text/x-python","patch_set":69,"id":"1910e8e2_a5a38046","line":161,"range":{"start_line":161,"start_character":12,"end_line":161,"end_character":31},"in_reply_to":"06dea9b4_91cfadc9","updated":"2024-07-22 07:24:31.000000000","message":"Done","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":182,"context_line":"        super(_SetHashValues, self).__init__("},{"line_number":183,"context_line":"            name\u003d\u0027%s-SetHashValues-%s\u0027 % (task_type, task_id))"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def execute(self):"},{"line_number":186,"context_line":"        \"\"\"Set user provided hash algo and value hash properties to image"},{"line_number":187,"context_line":"           when do_secure_hash is False."},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        :param image_id: Glance Image ID"},{"line_number":190,"context_line":"        :val_data: Validation Data provided by user"},{"line_number":191,"context_line":"        \"\"\""},{"line_number":192,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":193,"context_line":"        for k, v in self.val_data.items():"},{"line_number":194,"context_line":"            setattr(image, k, v)"},{"line_number":195,"context_line":"        self.image_repo.save(image)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def revert(self, result, **kwagrs):"},{"line_number":198,"context_line":"        \"\"\"Set properties back to None incase of failure and"}],"source_content_type":"text/x-python","patch_set":69,"id":"bf0da06d_79b811f0","line":195,"range":{"start_line":185,"start_character":4,"end_line":195,"end_character":35},"updated":"2024-07-18 05:18:20.000000000","message":"In which condition this task will fail?\nI don\u0027t think there is any failure scenario here. You can remove the revert call IMO.","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":182,"context_line":"        super(_SetHashValues, self).__init__("},{"line_number":183,"context_line":"            name\u003d\u0027%s-SetHashValues-%s\u0027 % (task_type, task_id))"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def execute(self):"},{"line_number":186,"context_line":"        \"\"\"Set user provided hash algo and value hash properties to image"},{"line_number":187,"context_line":"           when do_secure_hash is False."},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        :param image_id: Glance Image ID"},{"line_number":190,"context_line":"        :val_data: Validation Data provided by user"},{"line_number":191,"context_line":"        \"\"\""},{"line_number":192,"context_line":"        image \u003d self.image_repo.get(self.image_id)"},{"line_number":193,"context_line":"        for k, v in self.val_data.items():"},{"line_number":194,"context_line":"            setattr(image, k, v)"},{"line_number":195,"context_line":"        self.image_repo.save(image)"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def revert(self, result, **kwagrs):"},{"line_number":198,"context_line":"        \"\"\"Set properties back to None incase of failure and"}],"source_content_type":"text/x-python","patch_set":69,"id":"fe2b0213_a6e96366","line":195,"range":{"start_line":185,"start_character":4,"end_line":195,"end_character":35},"in_reply_to":"bf0da06d_79b811f0","updated":"2024-07-22 07:24:31.000000000","message":"Acknowledged","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c1edd8c5dbd2c50f2b1f76c9b8bc5cb059dc5b0a","unresolved":true,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"},{"line_number":88,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":89,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":70,"id":"37175f2a_73ea2c24","line":86,"range":{"start_line":86,"start_character":20,"end_line":86,"end_character":53},"updated":"2024-07-22 07:46:52.000000000","message":"I think this will cause failure to the tempest test which is depending on your logic [1] which is waiting to task to be completed with success.\n\n[1] https://review.opendev.org/c/openstack/tempest/+/924127/3/tempest/api/compute/servers/test_server_actions.py#614\n\n\nIf you raise exception from here the task will be marked as failure and not successful which will cause the test to be timed out on waiting to the task to be successful.\n\n\nI think you should only fail here if image.state is not active.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"df02fbc15e725eefdc6f591b57b1a476bc8c96ab","unresolved":true,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"},{"line_number":88,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":89,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":70,"id":"5f920341_efb7c931","line":86,"range":{"start_line":86,"start_character":20,"end_line":86,"end_character":53},"in_reply_to":"37175f2a_73ea2c24","updated":"2024-07-22 15:39:25.000000000","message":"+1 to what Abhishek said.\nIf the image is active and the hash calculation fails, the image create operation should succeed so raising this exception only when image status is not active makes sense.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a8196cb3589ba10fd0658acf354bdef421ac91db","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    raise _HashCalculationFailed(msg)"},{"line_number":87,"context_line":"            except store.exceptions.NotFound:"},{"line_number":88,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":89,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":70,"id":"3cbdf7b9_cd318b48","line":86,"range":{"start_line":86,"start_character":20,"end_line":86,"end_character":53},"in_reply_to":"37175f2a_73ea2c24","updated":"2024-07-25 06:56:38.000000000","message":"Done","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c1edd8c5dbd2c50f2b1f76c9b8bc5cb059dc5b0a","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":97,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":98,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":99,"context_line":"                image.delete()"},{"line_number":100,"context_line":"                self.image_repo.remove(image)"},{"line_number":101,"context_line":"                break"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"6a4cb874_fe7e3e48","line":99,"range":{"start_line":99,"start_character":16,"end_line":99,"end_character":30},"updated":"2024-07-22 07:46:52.000000000","message":"have you tested this scenario with cinder?\nWhat if glance is using cinder as a backend and image is deleted during hash calculation is in progress, will it cause failure saying `delete to delete transition is not allowed?`\n\nTo be safer side, you should check status here if image.state !\u003d deleted then delete the image OR confirm above scenario with cinder backend will not have any impact.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"88415d62ccd88ce74cf519641b9584a8e46141f2","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":97,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":98,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":99,"context_line":"                image.delete()"},{"line_number":100,"context_line":"                self.image_repo.remove(image)"},{"line_number":101,"context_line":"                break"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"9150f754_b2dac8b9","line":99,"range":{"start_line":99,"start_character":16,"end_line":99,"end_character":30},"in_reply_to":"6a4cb874_fe7e3e48","updated":"2024-07-22 09:12:20.000000000","message":"IIUC, to calculate hash, we do a similar workflow as downloading the image right?\nIf we try to open the cinder volume to get image data, the Image-Volume with be attached to the glance host and will be in \u0027in-use\u0027 state so I don\u0027t think we will be able to delete it.\nAlso delete should fail synchronously with 400 Bad Request and won\u0027t do async delete on the backend side (which i think is the case with RBD, hence we are doing this handling) so the image data should not be deleted on the Cinder side even if someone requests an image delete during hash calculation.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":27615,"name":"Rajat Dhasmana","email":"rajatdhasmana@gmail.com","username":"whoami-rajat"},"change_message_id":"9244269859ed73e4a658a9a0f1eb2e6aff045716","unresolved":true,"context_lines":[{"line_number":96,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":97,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":98,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":99,"context_line":"                image.delete()"},{"line_number":100,"context_line":"                self.image_repo.remove(image)"},{"line_number":101,"context_line":"                break"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"cfbf51dd_0f2728e8","line":99,"range":{"start_line":99,"start_character":16,"end_line":99,"end_character":30},"in_reply_to":"9150f754_b2dac8b9","updated":"2024-07-22 09:33:57.000000000","message":"Abhishek and I discussed this and we confirmed this by downloading an image and deleting at the same time, it fails with 400 BadRequest\n\nJul 22 14:58:59 Ubuntu glance-api[716298]: ERROR glance.common.wsgi cinderclient.exceptions.BadRequest: Invalid volume: Volume status must be available or error or error_restoring or error_extending or error_managing and must not be migrating, attached, belong to a group, have snapshots, awaiting a transfer, or be disassociated from snapshots after volume transfer. (HTTP 400) (Request-ID: req-ae1586c9-8951-44af-b5ca-421e636dc0cd)\n\nAlso tried to download the image again and it works as expected so the image data still exists in the Image-Volume.\n\nTo conclude, we should not enter in this except clause for NotFound excpetion when using Cinder as glance backend.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a8196cb3589ba10fd0658acf354bdef421ac91db","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":97,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":98,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":99,"context_line":"                image.delete()"},{"line_number":100,"context_line":"                self.image_repo.remove(image)"},{"line_number":101,"context_line":"                break"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"1407fcd5_dcd4478b","line":99,"range":{"start_line":99,"start_character":16,"end_line":99,"end_character":30},"in_reply_to":"cfbf51dd_0f2728e8","updated":"2024-07-25 06:56:38.000000000","message":"Acknowledged","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"76cea0a28c1514523f44f0ae08eab22524a6b9ba","unresolved":false,"context_lines":[{"line_number":96,"context_line":"                LOG.debug(_(\u0027Failed to calculate checksum of %(image_id)s \u0027"},{"line_number":97,"context_line":"                            \u0027as image data has been deleted from the \u0027"},{"line_number":98,"context_line":"                            \u0027backend\u0027), {\u0027image_id\u0027: self.image_id})"},{"line_number":99,"context_line":"                image.delete()"},{"line_number":100,"context_line":"                self.image_repo.remove(image)"},{"line_number":101,"context_line":"                break"},{"line_number":102,"context_line":""}],"source_content_type":"text/x-python","patch_set":70,"id":"d12d9928_8a0ca01b","line":99,"range":{"start_line":99,"start_character":16,"end_line":99,"end_character":30},"in_reply_to":"cfbf51dd_0f2728e8","updated":"2024-07-22 14:01:36.000000000","message":"Done","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c1edd8c5dbd2c50f2b1f76c9b8bc5cb059dc5b0a","unresolved":true,"context_lines":[{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        try:"},{"line_number":258,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":259,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":260,"context_line":"                image.locations.pop()"},{"line_number":261,"context_line":"                if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":262,"context_line":"                    image.status \u003d \u0027queued\u0027"}],"source_content_type":"text/x-python","patch_set":70,"id":"bc7f49df_896c8e36","line":259,"range":{"start_line":259,"start_character":40,"end_line":259,"end_character":59},"updated":"2024-07-22 07:46:52.000000000","message":"Again at this stage of task execution, image will have location so no need for this and condition IMO.","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a8196cb3589ba10fd0658acf354bdef421ac91db","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        try:"},{"line_number":258,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":259,"context_line":"            if image.status !\u003d \u0027active\u0027 and image.locations:"},{"line_number":260,"context_line":"                image.locations.pop()"},{"line_number":261,"context_line":"                if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":262,"context_line":"                    image.status \u003d \u0027queued\u0027"}],"source_content_type":"text/x-python","patch_set":70,"id":"6c58196c_68a74530","line":259,"range":{"start_line":259,"start_character":40,"end_line":259,"end_character":59},"in_reply_to":"bc7f49df_896c8e36","updated":"2024-07-25 06:56:38.000000000","message":"Done","commit_id":"0943ba5010bedb3216c298da0a577e5e857b150a"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7644f79b1508daad0576a1bf8e55804e5269ecd8","unresolved":true,"context_lines":[{"line_number":81,"context_line":"                          retries, CONF.http_retries,"},{"line_number":82,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":71,"id":"746dfd0a_6a49438f","line":85,"range":{"start_line":84,"start_character":20,"end_line":85,"end_character":53},"updated":"2024-07-25 07:21:13.000000000","message":"This should move inside if block below.\nAlso add a debug message here to say, Ignoring hash calculation as it is failed %d times.","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c6093e1930c7a260b51a98cb592ea6a171ab3406","unresolved":false,"context_lines":[{"line_number":81,"context_line":"                          retries, CONF.http_retries,"},{"line_number":82,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"}],"source_content_type":"text/x-python","patch_set":71,"id":"508e4b8d_f6c65f17","line":85,"range":{"start_line":84,"start_character":20,"end_line":85,"end_character":53},"in_reply_to":"746dfd0a_6a49438f","updated":"2024-07-25 10:32:06.000000000","message":"Done","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7644f79b1508daad0576a1bf8e55804e5269ecd8","unresolved":true,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"},{"line_number":89,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"}],"source_content_type":"text/x-python","patch_set":71,"id":"3c01a0a5_1529c46d","line":86,"updated":"2024-07-25 07:21:13.000000000","message":"You should add a note here to explain why you are doing this.","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c6093e1930c7a260b51a98cb592ea6a171ab3406","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"},{"line_number":89,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"}],"source_content_type":"text/x-python","patch_set":71,"id":"ecb5e36f_5476a79e","line":86,"in_reply_to":"3c01a0a5_1529c46d","updated":"2024-07-25 10:32:06.000000000","message":"Done","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7644f79b1508daad0576a1bf8e55804e5269ecd8","unresolved":true,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"},{"line_number":89,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":90,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":71,"id":"40675b4a_034003ab","line":87,"range":{"start_line":86,"start_character":20,"end_line":87,"end_character":57},"updated":"2024-07-25 07:21:13.000000000","message":"I think this case is missing from unit coverage.","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c6093e1930c7a260b51a98cb592ea6a171ab3406","unresolved":true,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"},{"line_number":89,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":90,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":71,"id":"fdd050a8_cf962a8e","line":87,"range":{"start_line":86,"start_character":20,"end_line":87,"end_character":57},"in_reply_to":"40675b4a_034003ab","updated":"2024-07-25 10:32:06.000000000","message":"I tried to cover it in the existing test [1] instead of having new one.\n\n[1]: https://review.opendev.org/c/openstack/glance/+/886749/71/glance/tests/unit/async_/flows/test_location_import.py#101","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"12aed15feca95ab6a907e2d69de1425456ebc76a","unresolved":false,"context_lines":[{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":85,"context_line":"                             \u0027data\u0027) % self.image_id)"},{"line_number":86,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":87,"context_line":"                        raise _HashCalculationFailed(msg)"},{"line_number":88,"context_line":"            except store.exceptions.NotFound:"},{"line_number":89,"context_line":"                # NOTE(pdeore): This can happen if image delete attempted"},{"line_number":90,"context_line":"                # when hash calculation is in progress, which deletes the"}],"source_content_type":"text/x-python","patch_set":71,"id":"7cf803dc_cb7ff930","line":87,"range":{"start_line":86,"start_character":20,"end_line":87,"end_character":57},"in_reply_to":"fdd050a8_cf962a8e","updated":"2024-07-25 13:50:38.000000000","message":"Acknowledged","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7644f79b1508daad0576a1bf8e55804e5269ecd8","unresolved":true,"context_lines":[{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":119,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":120,"context_line":"                if not image.locations[0][\u0027url\u0027].startswith(\"http\"):"},{"line_number":121,"context_line":"                    # NOTE(pdeore): `http` store doesn\u0027t allow deletion of"},{"line_number":122,"context_line":"                    # location:"},{"line_number":123,"context_line":"                    image.locations.pop()"},{"line_number":124,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":125,"context_line":"            image.os_hash_algo \u003d None"},{"line_number":126,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":71,"id":"5764fd89_1b8e973b","line":123,"range":{"start_line":120,"start_character":16,"end_line":123,"end_character":41},"updated":"2024-07-25 07:21:13.000000000","message":"This is also missing a unit test coverage.","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"12aed15feca95ab6a907e2d69de1425456ebc76a","unresolved":false,"context_lines":[{"line_number":117,"context_line":"        try:"},{"line_number":118,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":119,"context_line":"            if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":120,"context_line":"                if not image.locations[0][\u0027url\u0027].startswith(\"http\"):"},{"line_number":121,"context_line":"                    # NOTE(pdeore): `http` store doesn\u0027t allow deletion of"},{"line_number":122,"context_line":"                    # location:"},{"line_number":123,"context_line":"                    image.locations.pop()"},{"line_number":124,"context_line":"                image.status \u003d \u0027queued\u0027"},{"line_number":125,"context_line":"            image.os_hash_algo \u003d None"},{"line_number":126,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":71,"id":"df3095e4_dbb4a7b5","line":123,"range":{"start_line":120,"start_character":16,"end_line":123,"end_character":41},"in_reply_to":"5764fd89_1b8e973b","updated":"2024-07-25 13:50:38.000000000","message":"Done","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"7644f79b1508daad0576a1bf8e55804e5269ecd8","unresolved":true,"context_lines":[{"line_number":264,"context_line":"        try:"},{"line_number":265,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":266,"context_line":"            if image.status !\u003d \u0027active\u0027:"},{"line_number":267,"context_line":"                image.locations.pop()"},{"line_number":268,"context_line":"                if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":269,"context_line":"                    image.status \u003d \u0027queued\u0027"},{"line_number":270,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":71,"id":"1b6687bb_7ac00b26","line":267,"range":{"start_line":267,"start_character":16,"end_line":267,"end_character":37},"updated":"2024-07-25 07:21:13.000000000","message":"Don\u0027t you think http store will cause problem here as well?","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"c6093e1930c7a260b51a98cb592ea6a171ab3406","unresolved":false,"context_lines":[{"line_number":264,"context_line":"        try:"},{"line_number":265,"context_line":"            image \u003d self.image_repo.get(self.image_id)"},{"line_number":266,"context_line":"            if image.status !\u003d \u0027active\u0027:"},{"line_number":267,"context_line":"                image.locations.pop()"},{"line_number":268,"context_line":"                if image.status \u003d\u003d \u0027importing\u0027:"},{"line_number":269,"context_line":"                    image.status \u003d \u0027queued\u0027"},{"line_number":270,"context_line":"            self.image_repo.save(image)"}],"source_content_type":"text/x-python","patch_set":71,"id":"239498c0_021098fc","line":267,"range":{"start_line":267,"start_character":16,"end_line":267,"end_character":37},"in_reply_to":"1b6687bb_7ac00b26","updated":"2024-07-25 10:32:06.000000000","message":"Done","commit_id":"c692c42a585c33c8cbaaf0dad65602964b654611"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"12aed15feca95ab6a907e2d69de1425456ebc76a","unresolved":true,"context_lines":[{"line_number":82,"context_line":"                          encodeutils.exception_to_unicode(e))"},{"line_number":83,"context_line":"                if retries \u003d\u003d CONF.http_retries:"},{"line_number":84,"context_line":"                    if image.status !\u003d \u0027active\u0027:"},{"line_number":85,"context_line":"                        # NOTE(pdeore): The image location add operation"},{"line_number":86,"context_line":"                        # should succeed so this exception should be raised"},{"line_number":87,"context_line":"                        # only when image status is not active."},{"line_number":88,"context_line":"                        msg \u003d (_(\u0027Hash calculation failed for image %s \u0027"},{"line_number":89,"context_line":"                                 \u0027data\u0027) % self.image_id)"},{"line_number":90,"context_line":"                        raise _HashCalculationFailed(msg)"}],"source_content_type":"text/x-python","patch_set":72,"id":"d484826d_f87fd211","line":87,"range":{"start_line":85,"start_character":24,"end_line":87,"end_character":63},"updated":"2024-07-25 13:50:38.000000000","message":"We want to fail this task only if image location is added to http store.","commit_id":"a0b7650c4b526ee10312499c5b4ce5e890ec5e81"}],"glance/common/scripts/utils.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8105f237e5cf91b4695d8cf8897058436cc05829","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        if not task_input:"},{"line_number":68,"context_line":"            msg \u003d _(\"Input to do_secure_hash task is empty.\")"},{"line_number":69,"context_line":"            raise exception.Invalid(msg)"},{"line_number":70,"context_line":"        if \u0027image_id\u0027 not in task_input:"},{"line_number":71,"context_line":"            msg \u003d _(\"Missing required \u0027image_id\u0027 field\")"},{"line_number":72,"context_line":"            raise exception.Invalid(msg)"},{"line_number":73,"context_line":"    else:"},{"line_number":74,"context_line":"        for key in [\"import_from\", \"import_from_format\", \"image_properties\"]:"},{"line_number":75,"context_line":"            if key not in task_input:"}],"source_content_type":"text/x-python","patch_set":14,"id":"5a8031d9_00499152","line":72,"range":{"start_line":70,"start_character":8,"end_line":72,"end_character":40},"updated":"2023-08-09 17:23:26.000000000","message":"any idea why image id is validated and not val_data and loc_url?","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        if not task_input:"},{"line_number":68,"context_line":"            msg \u003d _(\"Input to do_secure_hash task is empty.\")"},{"line_number":69,"context_line":"            raise exception.Invalid(msg)"},{"line_number":70,"context_line":"        if \u0027image_id\u0027 not in task_input:"},{"line_number":71,"context_line":"            msg \u003d _(\"Missing required \u0027image_id\u0027 field\")"},{"line_number":72,"context_line":"            raise exception.Invalid(msg)"},{"line_number":73,"context_line":"    else:"},{"line_number":74,"context_line":"        for key in [\"import_from\", \"import_from_format\", \"image_properties\"]:"},{"line_number":75,"context_line":"            if key not in task_input:"}],"source_content_type":"text/x-python","patch_set":14,"id":"f4cd18b1_6f4626c2","line":72,"range":{"start_line":70,"start_character":8,"end_line":72,"end_character":40},"in_reply_to":"1ebfe0d8_e9439f8d","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":true,"context_lines":[{"line_number":67,"context_line":"        if not task_input:"},{"line_number":68,"context_line":"            msg \u003d _(\"Input to do_secure_hash task is empty.\")"},{"line_number":69,"context_line":"            raise exception.Invalid(msg)"},{"line_number":70,"context_line":"        if \u0027image_id\u0027 not in task_input:"},{"line_number":71,"context_line":"            msg \u003d _(\"Missing required \u0027image_id\u0027 field\")"},{"line_number":72,"context_line":"            raise exception.Invalid(msg)"},{"line_number":73,"context_line":"    else:"},{"line_number":74,"context_line":"        for key in [\"import_from\", \"import_from_format\", \"image_properties\"]:"},{"line_number":75,"context_line":"            if key not in task_input:"}],"source_content_type":"text/x-python","patch_set":14,"id":"1ebfe0d8_e9439f8d","line":72,"range":{"start_line":70,"start_character":8,"end_line":72,"end_character":40},"in_reply_to":"5a8031d9_00499152","updated":"2023-08-14 11:52:08.000000000","message":"I missed it to check. Added.","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":75,"context_line":"            raise exception.Invalid(msg)"},{"line_number":76,"context_line":"        if \u0027validation_data\u0027 not in task_input:"},{"line_number":77,"context_line":"            msg \u003d _(\"Missing required \u0027validation_data\u0027 field\")"},{"line_number":78,"context_line":"            raise exception.Invalid(msg)"},{"line_number":79,"context_line":"    else:"},{"line_number":80,"context_line":"        for key in [\"import_from\", \"import_from_format\", \"image_properties\"]:"},{"line_number":81,"context_line":"            if key not in task_input:"}],"source_content_type":"text/x-python","patch_set":17,"id":"440a3373_98484758","line":78,"updated":"2023-08-21 05:58:09.000000000","message":"You can do it the same way it is done at line 80 to reduce repetitive code.","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":75,"context_line":"            raise exception.Invalid(msg)"},{"line_number":76,"context_line":"        if \u0027validation_data\u0027 not in task_input:"},{"line_number":77,"context_line":"            msg \u003d _(\"Missing required \u0027validation_data\u0027 field\")"},{"line_number":78,"context_line":"            raise exception.Invalid(msg)"},{"line_number":79,"context_line":"    else:"},{"line_number":80,"context_line":"        for key in [\"import_from\", \"import_from_format\", \"image_properties\"]:"},{"line_number":81,"context_line":"            if key not in task_input:"}],"source_content_type":"text/x-python","patch_set":17,"id":"8c995fdc_005bddca","line":78,"in_reply_to":"440a3373_98484758","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"c6479de45db19de58f2d30c40bceb1d138ce47e2"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":63,"context_line":"        if \u0027image_id\u0027 not in task_input:"},{"line_number":64,"context_line":"            msg \u003d _(\"Missing required \u0027image_id\u0027 field\")"},{"line_number":65,"context_line":"            raise exception.Invalid(msg)"},{"line_number":66,"context_line":"    elif task_type \u003d\u003d \u0027location_import\u0027:"},{"line_number":67,"context_line":"        if not task_input:"},{"line_number":68,"context_line":"            msg \u003d _(\"Input to do_secure_hash task is empty.\")"},{"line_number":69,"context_line":"            raise exception.Invalid(msg)"}],"source_content_type":"text/x-python","patch_set":39,"id":"b0768b31_ac52392d","line":66,"updated":"2024-02-19 07:03:55.000000000","message":"do we have unit test coverage for below cases?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        if \u0027image_id\u0027 not in task_input:"},{"line_number":64,"context_line":"            msg \u003d _(\"Missing required \u0027image_id\u0027 field\")"},{"line_number":65,"context_line":"            raise exception.Invalid(msg)"},{"line_number":66,"context_line":"    elif task_type \u003d\u003d \u0027location_import\u0027:"},{"line_number":67,"context_line":"        if not task_input:"},{"line_number":68,"context_line":"            msg \u003d _(\"Input to do_secure_hash task is empty.\")"},{"line_number":69,"context_line":"            raise exception.Invalid(msg)"}],"source_content_type":"text/x-python","patch_set":39,"id":"2b394fd0_3590ad84","line":66,"in_reply_to":"b0768b31_ac52392d","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"}],"glance/common/store_utils.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8105f237e5cf91b4695d8cf8897058436cc05829","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"        else:"},{"line_number":246,"context_line":"            store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":247,"context_line":"            if store_id:"},{"line_number":248,"context_line":"                loc[\u0027metadata\u0027][\u0027store\u0027] \u003d store_id"}],"source_content_type":"text/x-python","patch_set":14,"id":"52c50670_5571f1c6","line":245,"range":{"start_line":245,"start_character":8,"end_line":245,"end_character":13},"updated":"2023-08-09 17:23:26.000000000","message":"nit: Instead of else I think continue will be better after line 244","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8db30c508cf8d1777a8559a81f8ceb58e964f6db","unresolved":false,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"        else:"},{"line_number":246,"context_line":"            store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":247,"context_line":"            if store_id:"},{"line_number":248,"context_line":"                loc[\u0027metadata\u0027][\u0027store\u0027] \u003d store_id"}],"source_content_type":"text/x-python","patch_set":14,"id":"1cad32f1_d164ee8c","line":245,"range":{"start_line":245,"start_character":8,"end_line":245,"end_character":13},"in_reply_to":"52c50670_5571f1c6","updated":"2023-08-14 11:52:08.000000000","message":"Done","commit_id":"e208b346c75519d1eb62e51246e1d60573493781"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"e7fb9adbd440b03bbbbe1453a7c8431c5c953dc4","unresolved":true,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"},{"line_number":249,"context_line":"            loc[\u0027metadata\u0027][\u0027store\u0027] \u003d store_id"},{"line_number":250,"context_line":"    return locations"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"c57d029f_7ecaaf6d","line":249,"range":{"start_line":249,"start_character":17,"end_line":249,"end_character":25},"updated":"2023-08-17 14:31:27.000000000","message":"This empty line can stay :)","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"6c1a2e2c2a25e2c1cafab0e91580e5da489547d1","unresolved":false,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"},{"line_number":249,"context_line":"            loc[\u0027metadata\u0027][\u0027store\u0027] \u003d store_id"},{"line_number":250,"context_line":"    return locations"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"be2c65b1_6419a483","line":249,"range":{"start_line":249,"start_character":17,"end_line":249,"end_character":25},"in_reply_to":"10161c03_15aea396","updated":"2023-08-24 11:41:16.000000000","message":"Done","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"2da44ed22d59d2fe22a66eb595fcaea666889da4","unresolved":true,"context_lines":[{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"},{"line_number":249,"context_line":"            loc[\u0027metadata\u0027][\u0027store\u0027] \u003d store_id"},{"line_number":250,"context_line":"    return locations"},{"line_number":251,"context_line":""},{"line_number":252,"context_line":""}],"source_content_type":"text/x-python","patch_set":16,"id":"10161c03_15aea396","line":249,"range":{"start_line":249,"start_character":17,"end_line":249,"end_character":25},"in_reply_to":"c57d029f_7ecaaf6d","updated":"2023-08-21 05:58:09.000000000","message":"+1","commit_id":"f62e95ccf32a3569b5c26e198eef5f15096c3527"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e07247b6dcc29b05232bf9cf2567011b913b9a07","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"ec0b5692_6cac62ca","line":245,"updated":"2024-01-16 15:22:31.000000000","message":"It\u0027s been a while since I did a deep dive on this, so apologies if I\u0027m forgetting, but: Is this related to the rest of the patch? If this is a fix (which it looks like) that stands on its own, could we pull it out and merge it separately? Also with an explanation of...why this change :)","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"e66b2d701e7e164462028033c1c491f8f6aec3f8","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"ed0a5da5_c24a5328","line":245,"in_reply_to":"5baa1d9e_6b56c2f7","updated":"2024-01-22 14:59:48.000000000","message":"It\u0027s needed, but it would stand on its own no?\n\nEither way, there are no tests for this in this patch.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"37e51127e0770decf7c240f34381c8d197ddaf65","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"5baa1d9e_6b56c2f7","line":245,"in_reply_to":"b778a533_78de10ba","updated":"2024-01-22 11:07:07.000000000","message":"It\u0027s related to this new add location API, since we doesn\u0027t pass metadata to this api and cinder sends location url as cinder://volume_id for single as well as multistore, glance side we need to modify that location url to be compatible with multistore as cinder://store_id/volume_id to avoid Invalid Location error from cinder side. This issue doesn\u0027t occur in old location api since metadata has been passed with store_id.\n\nmore details : https://review.opendev.org/c/openstack/glance/+/886749/12/glance/async_/flows/location_import.py#206","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"1764e7871eac977006a994bcb0fedb16583c1672","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"b778a533_78de10ba","line":245,"in_reply_to":"ba335caa_269b024f","updated":"2024-01-17 16:24:04.000000000","message":"...right, so this is just an unrelated (to the new location API) fix right? If so, let\u0027s pull it out in front, ideally with a bug explaining why, and get it merged separate from the api stuff.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"942b2726d7ab5a2d602b1bb1695a642ffef3e4dd","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba335caa_269b024f","line":245,"in_reply_to":"ec0b5692_6cac62ca","updated":"2024-01-17 14:26:25.000000000","message":"Yes, during cinder poc testing we noticed InvalidLocation exception in c-vol logs during upload-to-image since it\u0027s not getting the backends name in the knowns schemes, store_id not getting passed to metadata for add_location since it\u0027s not available in volume_type , https://github.com/openstack/cinder/blob/master/cinder/volume/manager.py#L1729\n\nHence we fixed it here.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"4786aa33fca74074e99681b4cbecdae6308284b3","unresolved":true,"context_lines":[{"line_number":242,"context_line":"    for loc in locations:"},{"line_number":243,"context_line":"        if loc[\u0027url\u0027].startswith(\"cinder://\") and context:"},{"line_number":244,"context_line":"            _update_cinder_location_and_store_id(context, loc)"},{"line_number":245,"context_line":"            continue"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"        store_id \u003d _get_store_id_from_uri(loc[\u0027url\u0027])"},{"line_number":248,"context_line":"        if store_id:"}],"source_content_type":"text/x-python","patch_set":33,"id":"861c2107_36cadcdc","line":245,"in_reply_to":"ed0a5da5_c24a5328","updated":"2024-01-23 11:19:07.000000000","message":"Ack, moved it to separate patch along with unit test.","commit_id":"fffb1fc7a75342a4faf7fa4d19fe41f0df7b66c7"}],"glance/common/utils.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8cac848a6a786d7c6f79aee8385bddad12251a70","unresolved":true,"context_lines":[{"line_number":126,"context_line":"    return readfn"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def calculate_hash(image):"},{"line_number":130,"context_line":"    current_os_hash_value \u003d hashlib.new(image.os_hash_algo)"},{"line_number":131,"context_line":"    current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":132,"context_line":"    for chunk in image.get_data():"}],"source_content_type":"text/x-python","patch_set":64,"id":"82247d27_c3f78f10","line":129,"updated":"2024-06-14 06:07:40.000000000","message":"I still think this method should accept hash-algo and return checksum and hash-value to make it more generic.","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e2d13e5644ef6d2e54cce02019c82daf72a0dc0b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    return readfn"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def calculate_hash(image):"},{"line_number":130,"context_line":"    current_os_hash_value \u003d hashlib.new(image.os_hash_algo)"},{"line_number":131,"context_line":"    current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":132,"context_line":"    for chunk in image.get_data():"}],"source_content_type":"text/x-python","patch_set":64,"id":"805a90f4_6166d5e4","line":129,"in_reply_to":"82247d27_c3f78f10","updated":"2024-06-14 07:12:31.000000000","message":"Done","commit_id":"d2e536a1aab7ac594c5ac6663e7c630d70f8a5a1"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"c73365b7be809b4e86c527c8a3288f837731bd8b","unresolved":true,"context_lines":[{"line_number":126,"context_line":"    return readfn"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def calculate_hash(image):"},{"line_number":130,"context_line":"    current_os_hash_value \u003d hashlib.new(image.os_hash_algo)"},{"line_number":131,"context_line":"    current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":132,"context_line":"    for chunk in image.get_data():"},{"line_number":133,"context_line":"        if chunk is None:"},{"line_number":134,"context_line":"            break"},{"line_number":135,"context_line":"        current_checksum.update(chunk)"},{"line_number":136,"context_line":"        current_os_hash_value.update(chunk)"},{"line_number":137,"context_line":"    image.checksum \u003d current_checksum.hexdigest()"},{"line_number":138,"context_line":"    image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"MAX_COOP_READER_BUFFER_SIZE \u003d 134217728  # 128M seems like a sane buffer limit"}],"source_content_type":"text/x-python","patch_set":67,"id":"def5f022_e98246c0","line":138,"range":{"start_line":129,"start_character":0,"end_line":138,"end_character":59},"updated":"2024-07-10 18:38:20.000000000","message":"Can we move this logic back to actual task?","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"845069df1666c9db4228b3f52fe7470ca315606b","unresolved":false,"context_lines":[{"line_number":126,"context_line":"    return readfn"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"def calculate_hash(image):"},{"line_number":130,"context_line":"    current_os_hash_value \u003d hashlib.new(image.os_hash_algo)"},{"line_number":131,"context_line":"    current_checksum \u003d secretutils.md5(usedforsecurity\u003dFalse)"},{"line_number":132,"context_line":"    for chunk in image.get_data():"},{"line_number":133,"context_line":"        if chunk is None:"},{"line_number":134,"context_line":"            break"},{"line_number":135,"context_line":"        current_checksum.update(chunk)"},{"line_number":136,"context_line":"        current_os_hash_value.update(chunk)"},{"line_number":137,"context_line":"    image.checksum \u003d current_checksum.hexdigest()"},{"line_number":138,"context_line":"    image.os_hash_value \u003d current_os_hash_value.hexdigest()"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"MAX_COOP_READER_BUFFER_SIZE \u003d 134217728  # 128M seems like a sane buffer limit"}],"source_content_type":"text/x-python","patch_set":67,"id":"0361a797_fbb82864","line":138,"range":{"start_line":129,"start_character":0,"end_line":138,"end_character":59},"in_reply_to":"def5f022_e98246c0","updated":"2024-07-16 10:25:41.000000000","message":"Acknowledged","commit_id":"8c7b754b8f93510c5730f399ed5da839ee19da38"}],"glance/tests/unit/async_/flows/test_location_import.py":[{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"ab4deada17a6ccdf0f856652e9b13716ed04da78","unresolved":true,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 RedHat Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":36,"id":"72d21623_f10debc6","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"updated":"2024-01-30 06:48:41.000000000","message":"nit 2024","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"a84bed3649409abbc717fb658645e03be0588acd","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright 2023 RedHat Inc."},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":36,"id":"b4edf1fb_15a8f856","line":1,"range":{"start_line":1,"start_character":12,"end_line":1,"end_character":16},"in_reply_to":"72d21623_f10debc6","updated":"2024-02-01 10:35:21.000000000","message":"Done","commit_id":"0489e85de3a121d92fa24ed26a8b40617c9ac803"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"095c3d54ed86a8b0cc2f4bf7f41c5501b2730b83","unresolved":true,"context_lines":[{"line_number":85,"context_line":"        hash_calculation.execute()"},{"line_number":86,"context_line":"        self.assertTrue(self.image.checksum)"},{"line_number":87,"context_line":"        self.assertTrue(self.image.os_hash_algo)"},{"line_number":88,"context_line":"        self.assertTrue(self.image.os_hash_value)"},{"line_number":89,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_execute_hash_calculation_fails_without_validation_data(self):"}],"source_content_type":"text/x-python","patch_set":38,"id":"735f6709_da85eab9","line":88,"updated":"2024-02-12 22:38:40.000000000","message":"So this probably works, but it\u0027s a bit weird. Why not use self.assertIsNotNone as is done in other parts of the tests?","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"18d487c0f15767d76f3437e9901a89a9a2ae17c9","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        hash_calculation.execute()"},{"line_number":86,"context_line":"        self.assertTrue(self.image.checksum)"},{"line_number":87,"context_line":"        self.assertTrue(self.image.os_hash_algo)"},{"line_number":88,"context_line":"        self.assertTrue(self.image.os_hash_value)"},{"line_number":89,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    def test_execute_hash_calculation_fails_without_validation_data(self):"}],"source_content_type":"text/x-python","patch_set":38,"id":"01d4cd02_76b45517","line":88,"in_reply_to":"735f6709_da85eab9","updated":"2024-02-15 09:09:17.000000000","message":"Ack, will change that.","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":8122,"name":"Cyril Roelandt","email":"cyril@redhat.com","username":"cyril.roelandt.enovance"},"change_message_id":"095c3d54ed86a8b0cc2f4bf7f41c5501b2730b83","unresolved":true,"context_lines":[{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"}],"source_content_type":"text/x-python","patch_set":38,"id":"d50c6504_20c26ead","line":127,"updated":"2024-02-12 22:38:40.000000000","message":"Isn\u0027t the revert() method supposed to be called automagically by Taskflow upon failure?","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"}],"source_content_type":"text/x-python","patch_set":38,"id":"2be396ac_11b051dc","line":127,"in_reply_to":"620670c2_c65ccecc","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"18d487c0f15767d76f3437e9901a89a9a2ae17c9","unresolved":true,"context_lines":[{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"}],"source_content_type":"text/x-python","patch_set":38,"id":"620670c2_c65ccecc","line":127,"in_reply_to":"d50c6504_20c26ead","updated":"2024-02-15 09:09:17.000000000","message":"since we have mocked the task here, revert should be separately called.","commit_id":"75f25994319cac05db1330ea2a1786cfaf48e14f"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":133,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":39,"id":"45d2405d_d4be4459","line":130,"updated":"2024-02-19 07:03:55.000000000","message":"Don\u0027t you think image should not be active in this case since image locations are 0?\nOr am I missing something?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":133,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":39,"id":"d8401e67_0279310d","line":130,"in_reply_to":"45d2405d_d4be4459","updated":"2024-02-20 10:24:30.000000000","message":"Image location will be popped out in revert but status will remain \u0027active\u0027.\nBut i just realized, since we this test is without validation data and if hash calculation fails, revert will not be called as the exception is not raised.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":127,"context_line":"        hash_calculation.revert(None)"},{"line_number":128,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":129,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":130,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":133,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":39,"id":"a467e9ef_04b3288f","line":130,"in_reply_to":"d8401e67_0279310d","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":160,"context_line":"        self.assertEqual(\u0027deleted\u0027, self.image.status)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        hash_calculation.revert(None)"},{"line_number":163,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def test_execute_hash_calculation_fails_with_validation_data(self):"},{"line_number":166,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":39,"id":"114362e9_d5bd2a0a","line":163,"updated":"2024-02-19 07:03:55.000000000","message":"Somewhere above you should verify that has_algo is set to image.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":160,"context_line":"        self.assertEqual(\u0027deleted\u0027, self.image.status)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"        hash_calculation.revert(None)"},{"line_number":163,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":164,"context_line":""},{"line_number":165,"context_line":"    def test_execute_hash_calculation_fails_with_validation_data(self):"},{"line_number":166,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":39,"id":"f68907cf_65edb39f","line":163,"in_reply_to":"114362e9_d5bd2a0a","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":208,"context_line":"            self.image.os_hash_value \u003d os_hash_value"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            self.assertEqual(1, mock_ch.call_count)"},{"line_number":211,"context_line":"            self.assertEqual(hashing_algo, self.image.os_hash_algo)"},{"line_number":212,"context_line":"            self.assertEqual(checksum, self.image.checksum)"},{"line_number":213,"context_line":"            self.assertEqual(os_hash_value, self.image.os_hash_value)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # Check number of times retry called incase of failure"},{"line_number":216,"context_line":"        self.image.checksum \u003d None"},{"line_number":217,"context_line":"        self.image.os_hash_value \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"faab29de_b0dda916","line":214,"range":{"start_line":211,"start_character":11,"end_line":214,"end_character":0},"updated":"2024-02-19 07:03:55.000000000","message":"I am not sure but I don\u0027t think this asserts make any sense here, because, you are assigning expected values to image at line 205 and 208 and asserting those here. I think execute method at line 200 should set those value and not you explicitly.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"96b662595c4d6e4259e13a76a7018f990f17656d","unresolved":true,"context_lines":[{"line_number":208,"context_line":"            self.image.os_hash_value \u003d os_hash_value"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            self.assertEqual(1, mock_ch.call_count)"},{"line_number":211,"context_line":"            self.assertEqual(hashing_algo, self.image.os_hash_algo)"},{"line_number":212,"context_line":"            self.assertEqual(checksum, self.image.checksum)"},{"line_number":213,"context_line":"            self.assertEqual(os_hash_value, self.image.os_hash_value)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # Check number of times retry called incase of failure"},{"line_number":216,"context_line":"        self.image.checksum \u003d None"},{"line_number":217,"context_line":"        self.image.os_hash_value \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"72bd1927_1eedca38","line":214,"range":{"start_line":211,"start_character":11,"end_line":214,"end_character":0},"in_reply_to":"08423d48_210998e4","updated":"2024-02-28 22:46:38.000000000","message":"This is still valid. This looks like it\u0027s asserting that the image\u0027s hash value is set to an expected value, but it\u0027s not, it\u0027s literally set to this value on L201 (and others above), it can\u0027t possibly be anything else. This is worse than harmless - it looks like we\u0027re checking something for sanity when we\u0027re not.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5c88d40919cb95a9ef3a7f5c349cee1ebf3d9530","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            self.image.os_hash_value \u003d os_hash_value"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            self.assertEqual(1, mock_ch.call_count)"},{"line_number":211,"context_line":"            self.assertEqual(hashing_algo, self.image.os_hash_algo)"},{"line_number":212,"context_line":"            self.assertEqual(checksum, self.image.checksum)"},{"line_number":213,"context_line":"            self.assertEqual(os_hash_value, self.image.os_hash_value)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # Check number of times retry called incase of failure"},{"line_number":216,"context_line":"        self.image.checksum \u003d None"},{"line_number":217,"context_line":"        self.image.os_hash_value \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"eae4c0a0_abaf396b","line":214,"range":{"start_line":211,"start_character":11,"end_line":214,"end_character":0},"in_reply_to":"55044e76_73f36fe8","updated":"2024-04-08 06:33:40.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"9db5b260adc311df5a0dcf251550b75eb3536e31","unresolved":true,"context_lines":[{"line_number":208,"context_line":"            self.image.os_hash_value \u003d os_hash_value"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            self.assertEqual(1, mock_ch.call_count)"},{"line_number":211,"context_line":"            self.assertEqual(hashing_algo, self.image.os_hash_algo)"},{"line_number":212,"context_line":"            self.assertEqual(checksum, self.image.checksum)"},{"line_number":213,"context_line":"            self.assertEqual(os_hash_value, self.image.os_hash_value)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # Check number of times retry called incase of failure"},{"line_number":216,"context_line":"        self.image.checksum \u003d None"},{"line_number":217,"context_line":"        self.image.os_hash_value \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"55044e76_73f36fe8","line":214,"range":{"start_line":211,"start_character":11,"end_line":214,"end_character":0},"in_reply_to":"72bd1927_1eedca38","updated":"2024-02-29 10:17:58.000000000","message":"Not sure how to test this scenario, is it really possible in the test to call one method with some error first and after it\u0027s first execution, pass it and check the call count of the other method called inside it.\nSo removing this atm.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":208,"context_line":"            self.image.os_hash_value \u003d os_hash_value"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            self.assertEqual(1, mock_ch.call_count)"},{"line_number":211,"context_line":"            self.assertEqual(hashing_algo, self.image.os_hash_algo)"},{"line_number":212,"context_line":"            self.assertEqual(checksum, self.image.checksum)"},{"line_number":213,"context_line":"            self.assertEqual(os_hash_value, self.image.os_hash_value)"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"        # Check number of times retry called incase of failure"},{"line_number":216,"context_line":"        self.image.checksum \u003d None"},{"line_number":217,"context_line":"        self.image.os_hash_value \u003d None"}],"source_content_type":"text/x-python","patch_set":39,"id":"08423d48_210998e4","line":214,"range":{"start_line":211,"start_character":11,"end_line":214,"end_character":0},"in_reply_to":"faab29de_b0dda916","updated":"2024-02-20 10:24:30.000000000","message":"Well, I\u0027m trying to test the scenario where hash calculation is successful in first retry hence i tried setting it explicitly and then i could check \"_set_checksum_and_hash\" is called once only.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":229,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":230,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        # If hash calculation fails, os_hash_value will be set to None"},{"line_number":233,"context_line":"        # so VerifyValidationData will raise error due to missing value of"},{"line_number":234,"context_line":"        # os_hash_value."},{"line_number":235,"context_line":"        self.image.get_data.side_effect \u003d IOError"},{"line_number":236,"context_line":"        with mock.patch.object(import_flow.LOG, \u0027debug\u0027) as mock_log:"},{"line_number":237,"context_line":"            hash_calculation.execute()"}],"source_content_type":"text/x-python","patch_set":39,"id":"d4d1db0c_672cb777","line":234,"range":{"start_line":232,"start_character":8,"end_line":234,"end_character":24},"updated":"2024-02-19 07:03:55.000000000","message":"IF hash calculation fails where are you setting os_hash_value to None?\nCan you verify that before line 242 that os_hash_value and checksum are None before calling verify_validation_data.execute?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":229,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":230,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":231,"context_line":""},{"line_number":232,"context_line":"        # If hash calculation fails, os_hash_value will be set to None"},{"line_number":233,"context_line":"        # so VerifyValidationData will raise error due to missing value of"},{"line_number":234,"context_line":"        # os_hash_value."},{"line_number":235,"context_line":"        self.image.get_data.side_effect \u003d IOError"},{"line_number":236,"context_line":"        with mock.patch.object(import_flow.LOG, \u0027debug\u0027) as mock_log:"},{"line_number":237,"context_line":"            hash_calculation.execute()"}],"source_content_type":"text/x-python","patch_set":39,"id":"1322890f_37f66d50","line":234,"range":{"start_line":232,"start_character":8,"end_line":234,"end_character":24},"in_reply_to":"d4d1db0c_672cb777","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":251,"context_line":"        hash_calculation.revert(None)"},{"line_number":252,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":253,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":254,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"class TestVerifyValidationDataTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":39,"id":"6f2247bb_95fa7a09","line":254,"range":{"start_line":254,"start_character":0,"end_line":254,"end_character":53},"updated":"2024-02-19 07:03:55.000000000","message":"You are setting it back to queued in verify_validation_data.revert so should be asserted there only.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":251,"context_line":"        hash_calculation.revert(None)"},{"line_number":252,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":253,"context_line":"        self.assertEqual(0, len(self.image.locations))"},{"line_number":254,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":""},{"line_number":257,"context_line":"class TestVerifyValidationDataTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":39,"id":"edcd7e07_b452682c","line":254,"range":{"start_line":254,"start_character":0,"end_line":254,"end_character":53},"in_reply_to":"6f2247bb_95fa7a09","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        verify_validation_data.execute()"},{"line_number":293,"context_line":"        self.assertEqual(\u0027sha512\u0027, self.image.os_hash_algo)"},{"line_number":294,"context_line":"        self.assertEqual(hash_value, self.image.os_hash_value)"},{"line_number":295,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":298,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"}],"source_content_type":"text/x-python","patch_set":39,"id":"f4155f59_2f8de684","line":295,"range":{"start_line":295,"start_character":26,"end_line":295,"end_character":32},"updated":"2024-02-19 07:03:55.000000000","message":"AFAIK image state should be importing here, right?\nWe call verify validation data only if do_secure_hash is true so that after hash is calculated we verify it with user provided data. In this case we set image status as importing.\n\nhttps://review.opendev.org/c/openstack/glance/+/886749/39/glance/async_/flows/location_import.py#334","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"98b05303b268a428f326050a6a70e6e884223d00","unresolved":false,"context_lines":[{"line_number":292,"context_line":"        verify_validation_data.execute()"},{"line_number":293,"context_line":"        self.assertEqual(\u0027sha512\u0027, self.image.os_hash_algo)"},{"line_number":294,"context_line":"        self.assertEqual(hash_value, self.image.os_hash_value)"},{"line_number":295,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":298,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7d4bf111_fd159017","line":295,"range":{"start_line":295,"start_character":26,"end_line":295,"end_character":32},"in_reply_to":"7b8cdbb4_f51bd766","updated":"2024-02-27 13:26:49.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":true,"context_lines":[{"line_number":292,"context_line":"        verify_validation_data.execute()"},{"line_number":293,"context_line":"        self.assertEqual(\u0027sha512\u0027, self.image.os_hash_algo)"},{"line_number":294,"context_line":"        self.assertEqual(hash_value, self.image.os_hash_value)"},{"line_number":295,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":298,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7b8cdbb4_f51bd766","line":295,"range":{"start_line":295,"start_character":26,"end_line":295,"end_character":32},"in_reply_to":"f4155f59_2f8de684","updated":"2024-02-20 10:24:30.000000000","message":"Yeah, I was just testing the _VerifyValidationData() separately here, HashCalculation sets image to \u0027importing\u0027. Updating the test.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":323,"context_line":"        verify_validation_data.execute()"},{"line_number":324,"context_line":"        self.assertEqual(\u0027sha256\u0027, self.image.os_hash_algo)"},{"line_number":325,"context_line":"        self.assertEqual(hash_value, self.image.os_hash_value)"},{"line_number":326,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":329,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"}],"source_content_type":"text/x-python","patch_set":39,"id":"0ff5786a_81ea7fc2","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":53},"updated":"2024-02-19 07:03:55.000000000","message":"ditto, image status will never be queued in verify validation data task.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        verify_validation_data.execute()"},{"line_number":324,"context_line":"        self.assertEqual(\u0027sha256\u0027, self.image.os_hash_algo)"},{"line_number":325,"context_line":"        self.assertEqual(hash_value, self.image.os_hash_value)"},{"line_number":326,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":329,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"}],"source_content_type":"text/x-python","patch_set":39,"id":"ff8158ab_5cd1d779","line":326,"range":{"start_line":326,"start_character":0,"end_line":326,"end_character":53},"in_reply_to":"0ff5786a_81ea7fc2","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":357,"context_line":"        verify_validation_data.revert(None)"},{"line_number":358,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":359,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":360,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"class TestSetHashValuesTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":39,"id":"4f1ad61f_015f1b20","line":360,"updated":"2024-02-19 07:03:55.000000000","message":"you are reverting image state as well, so that should also be asserted here.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":357,"context_line":"        verify_validation_data.revert(None)"},{"line_number":358,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":359,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":360,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"class TestSetHashValuesTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":39,"id":"bd97c4a6_ff17a2a8","line":360,"in_reply_to":"4f1ad61f_015f1b20","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":387,"context_line":"            \u0027os_hash_value\u0027: hash_value"},{"line_number":388,"context_line":"        }"},{"line_number":389,"context_line":"        self.hash_task_input.update(val_data\u003dval_data)"},{"line_number":390,"context_line":"        self.image.os_hash_value \u003d hash_value"},{"line_number":391,"context_line":"        self.image.os_hash_algo \u003d val_data.get(\"os_hash_algo\")"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        set_hash_data \u003d import_flow._SetHashValues("},{"line_number":394,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1, val_data)"}],"source_content_type":"text/x-python","patch_set":39,"id":"3111695b_9345e74c","line":391,"range":{"start_line":390,"start_character":8,"end_line":391,"end_character":62},"updated":"2024-02-19 07:03:55.000000000","message":"Again, I think your below task should set these values to image.\nOtherwise no use of asserting those if you are setting it here by youself.","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":387,"context_line":"            \u0027os_hash_value\u0027: hash_value"},{"line_number":388,"context_line":"        }"},{"line_number":389,"context_line":"        self.hash_task_input.update(val_data\u003dval_data)"},{"line_number":390,"context_line":"        self.image.os_hash_value \u003d hash_value"},{"line_number":391,"context_line":"        self.image.os_hash_algo \u003d val_data.get(\"os_hash_algo\")"},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"        set_hash_data \u003d import_flow._SetHashValues("},{"line_number":394,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1, val_data)"}],"source_content_type":"text/x-python","patch_set":39,"id":"80129c75_401e28cb","line":391,"range":{"start_line":390,"start_character":8,"end_line":391,"end_character":62},"in_reply_to":"3111695b_9345e74c","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":401,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":402,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"},{"line_number":403,"context_line":"        set_image_active.execute()"},{"line_number":404,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def test_execute_with_set_hash_data_failure(self):"},{"line_number":407,"context_line":"        url \u003d \u0027%s/fake_location_1\u0027 % BASE_URI"}],"source_content_type":"text/x-python","patch_set":39,"id":"e967faf2_0c101f8e","line":404,"range":{"start_line":404,"start_character":0,"end_line":404,"end_character":53},"updated":"2024-02-19 07:03:55.000000000","message":"like here you are not setting image to active but your execute method line 403 is doing it, similar should happen for line 390 and 391","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        set_image_active \u003d import_flow._SetImageToActiveTask("},{"line_number":402,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1)"},{"line_number":403,"context_line":"        set_image_active.execute()"},{"line_number":404,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def test_execute_with_set_hash_data_failure(self):"},{"line_number":407,"context_line":"        url \u003d \u0027%s/fake_location_1\u0027 % BASE_URI"}],"source_content_type":"text/x-python","patch_set":39,"id":"6791432d_426b1983","line":404,"range":{"start_line":404,"start_character":0,"end_line":404,"end_character":53},"in_reply_to":"e967faf2_0c101f8e","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":416,"context_line":"            \u0027os_hash_value\u0027: hash_value"},{"line_number":417,"context_line":"        }"},{"line_number":418,"context_line":"        self.hash_task_input.update(val_data\u003dval_data)"},{"line_number":419,"context_line":"        self.image.os_hash_value \u003d hash_value"},{"line_number":420,"context_line":"        self.image.os_hash_algo \u003d val_data.get(\"os_hash_algo\")"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        set_hash_data \u003d import_flow._SetHashValues("},{"line_number":423,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1, val_data)"}],"source_content_type":"text/x-python","patch_set":39,"id":"3e2dcc24_68f03f11","line":420,"range":{"start_line":419,"start_character":4,"end_line":420,"end_character":62},"updated":"2024-02-19 07:03:55.000000000","message":"ditto","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":416,"context_line":"            \u0027os_hash_value\u0027: hash_value"},{"line_number":417,"context_line":"        }"},{"line_number":418,"context_line":"        self.hash_task_input.update(val_data\u003dval_data)"},{"line_number":419,"context_line":"        self.image.os_hash_value \u003d hash_value"},{"line_number":420,"context_line":"        self.image.os_hash_algo \u003d val_data.get(\"os_hash_algo\")"},{"line_number":421,"context_line":""},{"line_number":422,"context_line":"        set_hash_data \u003d import_flow._SetHashValues("},{"line_number":423,"context_line":"            TASK_ID1, TASK_TYPE, self.image_repo, IMAGE_ID1, val_data)"}],"source_content_type":"text/x-python","patch_set":39,"id":"4b812a3d_b82759a4","line":420,"range":{"start_line":419,"start_character":4,"end_line":420,"end_character":62},"in_reply_to":"3e2dcc24_68f03f11","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[{"line_number":476,"context_line":"    def test_execute_with_invalid_location(self):"},{"line_number":477,"context_line":"        self.image.locations.append.side_effect \u003d exception.BadStoreUri"},{"line_number":478,"context_line":"        loc_url \u003d \u0027bogus_url\u0027"},{"line_number":479,"context_line":"        self.image.status \u003d \u0027queued\u0027"},{"line_number":480,"context_line":"        self.location_task_input.update(loc_url\u003dloc_url)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        location_update \u003d import_flow._UpdateLocationTask("}],"source_content_type":"text/x-python","patch_set":39,"id":"56c69ac9_456ab823","line":479,"range":{"start_line":479,"start_character":0,"end_line":479,"end_character":36},"updated":"2024-02-19 07:03:55.000000000","message":"should be asserted somewhere?","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[{"line_number":476,"context_line":"    def test_execute_with_invalid_location(self):"},{"line_number":477,"context_line":"        self.image.locations.append.side_effect \u003d exception.BadStoreUri"},{"line_number":478,"context_line":"        loc_url \u003d \u0027bogus_url\u0027"},{"line_number":479,"context_line":"        self.image.status \u003d \u0027queued\u0027"},{"line_number":480,"context_line":"        self.location_task_input.update(loc_url\u003dloc_url)"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        location_update \u003d import_flow._UpdateLocationTask("}],"source_content_type":"text/x-python","patch_set":39,"id":"529573fe_8fb96817","line":479,"range":{"start_line":479,"start_character":0,"end_line":479,"end_character":36},"in_reply_to":"56c69ac9_456ab823","updated":"2024-02-20 10:24:30.000000000","message":"Acknowledged","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"8565be6c89c4851f7aad3d6098db9680b5dfea0d","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":39,"id":"59c6a373_564af029","line":548,"updated":"2024-02-19 07:03:55.000000000","message":"you should assert image is queued here as well","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"76dde0bc56d218a1f22ba9b18a94cae601d8104f","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":39,"id":"cefa1a96_82ed8a8b","line":548,"in_reply_to":"59c6a373_564af029","updated":"2024-02-20 10:24:30.000000000","message":"Done","commit_id":"6205221c7a40391d104470340d12b4193a38d08c"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"308829f3539121c195563692f97ea17b80986d54","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNotNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":50,"id":"3611b811_4a48e55c","line":125,"updated":"2024-02-28 10:19:21.000000000","message":"I think you should call revert here after line 125 and verify that os_hash_algo is None and image is active and has location as well","commit_id":"3ff77f731fb982d2a21a096e0ffc92a2ac73e4d8"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"8801a4382119be7da7ba56353578044f28b7fbb6","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNotNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":50,"id":"3e472fb1_13b59baa","line":125,"in_reply_to":"3611b811_4a48e55c","updated":"2024-02-28 11:14:01.000000000","message":"Incase of Validation data is None, if CalculateHash fails with IOError then exception will not be raised instead we are passing that task hence revert will not be get called in that case.","commit_id":"3ff77f731fb982d2a21a096e0ffc92a2ac73e4d8"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"9b40971c94405ea2708a2c3dee89f08db619b8f9","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNotNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":50,"id":"e2855377_970a4019","line":125,"in_reply_to":"3e472fb1_13b59baa","updated":"2024-02-28 12:07:39.000000000","message":"Agree, but os_hash_algo should be None in this case, which you have done now!\nAs stated in my comment above you should have validated that location is present as well.\n\nDo that if new PS is required","commit_id":"3ff77f731fb982d2a21a096e0ffc92a2ac73e4d8"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"9db5b260adc311df5a0dcf251550b75eb3536e31","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNotNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":50,"id":"a85197c6_675fa3dc","line":125,"in_reply_to":"e2855377_970a4019","updated":"2024-02-29 10:17:58.000000000","message":"Done","commit_id":"3ff77f731fb982d2a21a096e0ffc92a2ac73e4d8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"96b662595c4d6e4259e13a76a7018f990f17656d","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"2721ee19_8511fc7d","line":125,"updated":"2024-02-28 22:46:38.000000000","message":"I\u0027m not sure about this. You\u0027re asserting that if we had no hash to _verify_ that we should treat something as severe as an IOError as non-fatal and just mark the image as active?\n\nIsn\u0027t the point of this to get us to a point where we have hashes for all the images? And even still, if we can\u0027t read the image immediately after upload, it\u0027s unlikely that it\u0027s going to be usable, right?","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"708ab290cf07c0060646bfe7fbf41642d42fb9e1","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"3c03fc89_6865b539","line":125,"in_reply_to":"245c903d_d0439f3a","updated":"2024-04-04 07:01:10.000000000","message":"Ack, I will add this in the seperate follow up patch.","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"e2beeb0445b80ef533e9ce1c06ed4b6b6ec66362","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"f2d9d26d_ec2d791f","line":125,"in_reply_to":"2721ee19_8511fc7d","updated":"2024-02-29 04:32:57.000000000","message":"This is as per sepc where we decided that if do_secure_hash is True but no validation data is provided then we will immediately set image to active and calculate the hash in background. Even the hash calculation fails we will just log warning and keep image active (to behave same as old location API).","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"d0722dd8a229e15f7f8d6e909a3d173812d01a85","unresolved":false,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"c7038910_976e3942","line":125,"in_reply_to":"3c03fc89_6865b539","updated":"2024-06-06 06:48:24.000000000","message":"Acknowledged","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"b55eb8593e85eec518efbad5cabfa24fbccf5c29","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"245c903d_d0439f3a","line":125,"in_reply_to":"933dac13_c6671d22","updated":"2024-02-29 15:32:50.000000000","message":"+1 to have this as CLI to run from cron. This way we can have hash for legacy images as well.","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a94ffb88bbaaefdb065800405517cdf8366d2e13","unresolved":true,"context_lines":[{"line_number":122,"context_line":"            self.assertIsNone(self.image.os_hash_algo)"},{"line_number":123,"context_line":"            self.assertIsNone(self.image.checksum)"},{"line_number":124,"context_line":"            self.assertIsNone(self.image.os_hash_value)"},{"line_number":125,"context_line":"            self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":128,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":54,"id":"933dac13_c6671d22","line":125,"in_reply_to":"f2d9d26d_ec2d791f","updated":"2024-02-29 15:25:42.000000000","message":"Yeah, I know, but seeing it here where we can\u0027t read it makes me wonder about the sense of thet design point. I guess if we mark it as active immediately and then later mark it as error because we can\u0027t read it that might upset someone that *was* able to use it. I guess I\u0027m, just thinking about the case where this hits a transient failure and we never get a hash for this image that we plan to use for a year.\n\nLike, maybe we need some way to re-trigger hash calculations, or perhaps a periodic (which is hard with glance because we need a lock and to decide who is going to do it). Or perhaps a glance-manage command to run from cron.","commit_id":"3b91bcd73e6a965e953503b175b7c9b883240390"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"efdfda7a43cb9779d0d414265f6cb7b280e5e2ac","unresolved":true,"context_lines":[{"line_number":198,"context_line":"        self.assertEqual(CONF.http_retries, self.image.get_data.call_count)"},{"line_number":199,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":200,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":201,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        # If hash calculation fails, os_hash_value will be set to None"},{"line_number":204,"context_line":"        # so VerifyValidationData will raise error due to missing value of"}],"source_content_type":"text/x-python","patch_set":56,"id":"4008a47d_f24d11be","line":201,"updated":"2024-02-29 15:31:47.000000000","message":"I gave you a very simple and concise test for checking the retry loop. Please put that in this file as it\u0027s much easier to reason about than this very very large test and tests the retry loop in isolation. It\u0027s okay if it has some overlap with the others here.","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"5c88d40919cb95a9ef3a7f5c349cee1ebf3d9530","unresolved":false,"context_lines":[{"line_number":198,"context_line":"        self.assertEqual(CONF.http_retries, self.image.get_data.call_count)"},{"line_number":199,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":200,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":201,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"        # If hash calculation fails, os_hash_value will be set to None"},{"line_number":204,"context_line":"        # so VerifyValidationData will raise error due to missing value of"}],"source_content_type":"text/x-python","patch_set":56,"id":"7fda408d_fcebca53","line":201,"in_reply_to":"4008a47d_f24d11be","updated":"2024-04-08 06:33:40.000000000","message":"Done","commit_id":"ddaa0b9c716797e4c6424f03c5f64dca3ff33a1e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9240f86017848531b99f3c527c6cd8e53e878783","unresolved":true,"context_lines":[{"line_number":98,"context_line":"        self.image.get_data.side_effect \u003d IOError"},{"line_number":99,"context_line":"        self.config(http_retries\u003d\u002710\u0027)"},{"line_number":100,"context_line":"        hash_calculation.execute()"},{"line_number":101,"context_line":"        self.assertEqual(CONF.http_retries, self.image.get_data.call_count)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_execute_hash_calculation_fails_without_validation_data(self):"},{"line_number":104,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":58,"id":"a37e7169_0c13f952","line":101,"updated":"2024-04-23 14:16:05.000000000","message":"You\u0027re making it fail 10 times in a row and also basically asserting that it doesn\u0027t ever fail. This needs to check that we can call it 10 times and then *FAIL*.","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"82835a458a4574548f4c0bc37395965caf76528a","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        self.image.get_data.side_effect \u003d IOError"},{"line_number":99,"context_line":"        self.config(http_retries\u003d\u002710\u0027)"},{"line_number":100,"context_line":"        hash_calculation.execute()"},{"line_number":101,"context_line":"        self.assertEqual(CONF.http_retries, self.image.get_data.call_count)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def test_execute_hash_calculation_fails_without_validation_data(self):"},{"line_number":104,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":58,"id":"a970a850_a33c8141","line":101,"in_reply_to":"a37e7169_0c13f952","updated":"2024-04-29 08:05:40.000000000","message":"Done","commit_id":"714dab933b7218314e026c9edb79d23611e16580"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":155,"context_line":"            self.assertEqual(1, len(self.image.locations))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        hash_calculation.revert(None)"},{"line_number":158,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":161,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":69,"id":"ed842e6a_9c524683","line":158,"updated":"2024-07-18 05:18:20.000000000","message":"here you should also check image is active and has desired location","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":155,"context_line":"            self.assertEqual(1, len(self.image.locations))"},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"        hash_calculation.revert(None)"},{"line_number":158,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    def test_execute_hash_calculation_fails_if_image_data_deleted(self):"},{"line_number":161,"context_line":"        self.loc_url \u003d \u0027%s/fake_location_1\u0027 % (BASE_URI)"}],"source_content_type":"text/x-python","patch_set":69,"id":"cbdfa1de_f8b6be49","line":158,"in_reply_to":"ed842e6a_9c524683","updated":"2024-07-22 07:24:31.000000000","message":"Acknowledged","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":315,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":316,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":317,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":318,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"class TestSetHashValuesTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":69,"id":"1a4f2f17_ac1be174","line":318,"updated":"2024-07-18 05:18:20.000000000","message":"location?","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":315,"context_line":"        self.assertIsNone(self.image.os_hash_algo)"},{"line_number":316,"context_line":"        self.assertIsNone(self.image.os_hash_value)"},{"line_number":317,"context_line":"        self.assertIsNone(self.image.checksum)"},{"line_number":318,"context_line":"        self.assertEqual(\u0027queued\u0027, self.image.status)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":""},{"line_number":321,"context_line":"class TestSetHashValuesTask(test_utils.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":69,"id":"ecf86f70_4c844497","line":318,"in_reply_to":"1a4f2f17_ac1be174","updated":"2024-07-22 07:24:31.000000000","message":"Done","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":9303,"name":"Abhishek Kekane","email":"akekane@redhat.com","username":"abhishekkekane"},"change_message_id":"66211130d5ebc9a0f1beb67f58a906e8f8850e4d","unresolved":true,"context_lines":[{"line_number":359,"context_line":"        set_image_active.execute()"},{"line_number":360,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def test_execute_with_set_hash_data_failure(self):"},{"line_number":363,"context_line":"        url \u003d \u0027%s/fake_location_1\u0027 % BASE_URI"},{"line_number":364,"context_line":"        self.image.status \u003d \u0027queued\u0027"},{"line_number":365,"context_line":"        self.image.locations \u003d {\"url\": url, \"metadata\": {\"store\": \"foo\"}}"}],"source_content_type":"text/x-python","patch_set":69,"id":"f5abd754_38a7519e","line":362,"updated":"2024-07-18 05:18:20.000000000","message":"Don\u0027t think this is required","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"},{"author":{"_account_id":19138,"name":"Pranali Deore","email":"pdeore@redhat.com","username":"PranaliD"},"change_message_id":"01b3485df719b296440b6b09208fb6acb54ac80a","unresolved":false,"context_lines":[{"line_number":359,"context_line":"        set_image_active.execute()"},{"line_number":360,"context_line":"        self.assertEqual(\u0027active\u0027, self.image.status)"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def test_execute_with_set_hash_data_failure(self):"},{"line_number":363,"context_line":"        url \u003d \u0027%s/fake_location_1\u0027 % BASE_URI"},{"line_number":364,"context_line":"        self.image.status \u003d \u0027queued\u0027"},{"line_number":365,"context_line":"        self.image.locations \u003d {\"url\": url, \"metadata\": {\"store\": \"foo\"}}"}],"source_content_type":"text/x-python","patch_set":69,"id":"452098c6_afd55c82","line":362,"in_reply_to":"f5abd754_38a7519e","updated":"2024-07-22 07:24:31.000000000","message":"Acknowledged","commit_id":"61c2e37cf5937d633beab52111f420503b0171e0"}]}
