)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"d9aeb11ec28c9709b7f0eaff550eec59e38fc999","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"fafd66bf_ddf24a64","updated":"2023-09-28 13:33:19.000000000","message":"LGTM, thanks Kiran","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"60f9981ffdc5a8e9e15bc1987deab50b36658643","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"92398e43_3478dea9","updated":"2023-10-07 00:20:31.000000000","message":"Thanks for this fix Kiran, i\u0027ve a suggestion inline..","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":18816,"name":"Maurice Escher","display_name":"carthaca","email":"maurice.escher@sap.com","username":"mapocace"},"change_message_id":"cb47a32e37c14dd3c8acca28826f8e993f0b336c","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"1ad81059_9762406e","updated":"2023-09-27 07:52:58.000000000","message":"lgtm","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"f5fa64191c6f382ef5dd039df2c7efcc4ed83b12","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"d3aa1aa5_794e3421","updated":"2023-10-24 23:45:47.000000000","message":"Hi @Kiran; could you please backport this to older stable releases? Thanks!","commit_id":"cd767dd468fd7c99dc24e7e54262be4e3ba9aaa9"},{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"1055abfb55c6397b8ef681c16c6da42bf83a66bb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":4,"id":"807836fe_7552262d","updated":"2023-10-11 11:31:34.000000000","message":"LGTM, thanks Kiran","commit_id":"cd767dd468fd7c99dc24e7e54262be4e3ba9aaa9"}],"manila/api/v2/share_networks.py":[{"author":{"_account_id":29632,"name":"Carlos Eduardo","email":"ces.eduardo98@gmail.com","username":"silvacarlos"},"change_message_id":"d9aeb11ec28c9709b7f0eaff550eec59e38fc999","unresolved":true,"context_lines":[{"line_number":130,"context_line":"                raise exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"874fff6d_6bc2145c","line":134,"range":{"start_line":133,"start_character":12,"end_line":134,"end_character":76},"updated":"2023-09-28 13:33:19.000000000","message":"Some thoughts on this: the deletion of the share servers are asynchronous. I\u0027m afraid we\u0027d have issues in case the share server deletion failed, and that could cause some issues.\n\nThough, the share network deletion happens right after, and the share network subnet would be orphaned anyways, so that\u0027s kind of a decision we took a while ago. I\u0027m okay with leaving this as is then","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"098cb02444e1580bbee0b51c3d2a210c6d38f2f6","unresolved":false,"context_lines":[{"line_number":130,"context_line":"                raise exc.HTTPConflict(explanation\u003dmsg)"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"a5f87da9_1974efc6","line":134,"range":{"start_line":133,"start_character":12,"end_line":134,"end_character":76},"in_reply_to":"874fff6d_6bc2145c","updated":"2023-10-02 08:47:36.000000000","message":"yes, this is same behaviour of share network subnet deletion API.","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"60f9981ffdc5a8e9e15bc1987deab50b36658643","unresolved":true,"context_lines":[{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"2c0b9a95_8057fabd","line":135,"range":{"start_line":135,"start_character":12,"end_line":135,"end_character":69},"updated":"2023-10-07 00:20:31.000000000","message":"Shouldn\u0027t this be done here: \n\nhttps://github.com/openstack/manila/blob/6250c50e199d385dcba17b8512bbbffea92a3d32/manila/db/sqlalchemy/api.py#L4602-L4604\n\nso that we can prevent/protect the possibility of the share network being cleaned up directly through other interfaces..","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"22d1ef195098286434f2a87e42409cb4182dc142","unresolved":true,"context_lines":[{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f43c703_7e0f4d58","line":135,"range":{"start_line":135,"start_character":12,"end_line":135,"end_character":69},"in_reply_to":"2c0b9a95_8057fabd","updated":"2023-10-09 13:08:55.000000000","message":"share network can contain multiple share network subnets in orm relationship, so I think we should not do it there. let me know if you think otherwise.","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"9039bf4cecb3da55f14550e92f679364ce037bc8","unresolved":true,"context_lines":[{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9e87a372_38a770a5","line":135,"range":{"start_line":135,"start_character":12,"end_line":135,"end_character":69},"in_reply_to":"3f43c703_7e0f4d58","updated":"2023-10-09 17:11:28.000000000","message":"i\u0027m aware of that :) \n\nA share network object has an attribute called \"share_network_subnets\" https://github.com/openstack/manila/blob/6250c50e199d385dcba17b8512bbbffea92a3d32/manila/db/sqlalchemy/models.py#L982; iterating over this and deleting each would be a good approach in the sqlalchemy layer. \n\nThe reason I say this is precisely the opposite of what you\u0027re mentioning; leaving the deletion here could be a source of a future bug when the share network is deleted through another code path.\n\n\nwe\u0027re handling deletions with multiple/related objects in this layer like this: \n\nhttps://github.com/openstack/manila/blob/6250c50e199d385dcba17b8512bbbffea92a3d32/manila/db/sqlalchemy/api.py#L2543-L2544\n\nhttps://github.com/openstack/manila/blob/master/manila/db/sqlalchemy/api.py#L1884-L1885\n\nhttps://github.com/openstack/manila/blob/6250c50e199d385dcba17b8512bbbffea92a3d32/manila/db/sqlalchemy/api.py#L3106-L3121\n\nhttps://github.com/openstack/manila/blob/6250c50e199d385dcba17b8512bbbffea92a3d32/manila/db/sqlalchemy/api.py#L3218-L3219\n\n\n\nAn alternative is to use cascading deletions properly; but, I am not fully aware of why that wasn\u0027t considered with manila\u0027s DB API.","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"8971cd5e5334fecfdc05dbc6fab01a61676dac20","unresolved":false,"context_lines":[{"line_number":132,"context_line":"        for subnet in share_network[\u0027share_network_subnets\u0027]:"},{"line_number":133,"context_line":"            for share_server in subnet[\u0027share_servers\u0027]:"},{"line_number":134,"context_line":"                self.share_rpcapi.delete_share_server(context, share_server)"},{"line_number":135,"context_line":"            db_api.share_network_subnet_delete(context, subnet[\u0027id\u0027])"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"        db_api.share_network_delete(context, id)"},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"d824d8ff_e965afe9","line":135,"range":{"start_line":135,"start_character":12,"end_line":135,"end_character":69},"in_reply_to":"9e87a372_38a770a5","updated":"2023-10-10 10:46:45.000000000","message":"Done","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"}],"manila/tests/db/sqlalchemy/test_api.py":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"6af4c70792c3b00df1ddb1dc9710ed2268ac04e3","unresolved":true,"context_lines":[{"line_number":2753,"context_line":""},{"line_number":2754,"context_line":"        db_api.share_network_delete(self.fake_context,"},{"line_number":2755,"context_line":"                                    self.share_nw_dict[\u0027id\u0027])"},{"line_number":2756,"context_line":"        mock_share_network_subnet_delete.assert_called()"},{"line_number":2757,"context_line":""},{"line_number":2758,"context_line":"    def test_delete_not_found(self):"},{"line_number":2759,"context_line":"        self.assertRaises(exception.ShareNetworkNotFound,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f986cd2_8f8ab546","line":2756,"range":{"start_line":2756,"start_character":41,"end_line":2756,"end_character":56},"updated":"2023-10-10 23:11:57.000000000","message":"assert_called() (and \"assert_called_once\") should be used sparingly; better alternatives exist:\n\n1) when you expect something to be called multiple times, use assert_has_calls and make sure you assert the \"call_count\" is equal to what you expect\n2) when you expect a call to only be made once, use \"assert_called_once_with\"\n\n\nMaking tighter asserts will prevent bugs.\n\nAlso in this case, you\u0027re using real database entries, so you might actually verify if the share network subnets are really deleted instead of mocking the method.","commit_id":"a4ae7c2875f747b93ddf4314e3468fd0f1ae9bc1"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"105f9210e9e2ffbd7893fe088a6d08d6cb81cf1b","unresolved":false,"context_lines":[{"line_number":2753,"context_line":""},{"line_number":2754,"context_line":"        db_api.share_network_delete(self.fake_context,"},{"line_number":2755,"context_line":"                                    self.share_nw_dict[\u0027id\u0027])"},{"line_number":2756,"context_line":"        mock_share_network_subnet_delete.assert_called()"},{"line_number":2757,"context_line":""},{"line_number":2758,"context_line":"    def test_delete_not_found(self):"},{"line_number":2759,"context_line":"        self.assertRaises(exception.ShareNetworkNotFound,"}],"source_content_type":"text/x-python","patch_set":3,"id":"2c09047f_96d2ce97","line":2756,"range":{"start_line":2756,"start_character":41,"end_line":2756,"end_character":56},"in_reply_to":"5f986cd2_8f8ab546","updated":"2023-10-11 11:28:55.000000000","message":"ok, removed mocks and checkd for subnet after share network delete.","commit_id":"a4ae7c2875f747b93ddf4314e3468fd0f1ae9bc1"}],"releasenotes/notes/bug-2037422-delete-share-network-subnet-on-network-deletion-b28b42ce4a42b554.yaml":[{"author":{"_account_id":16643,"name":"Goutham Pacha Ravi","email":"gouthampravi@gmail.com","username":"gouthamr"},"change_message_id":"60f9981ffdc5a8e9e15bc1987deab50b36658643","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Default share network subnet is deleted when share network is deleted, in"},{"line_number":5,"context_line":"    case it is the only subnet present in share network. Please refer to the"},{"line_number":6,"context_line":"    `Launchpad bug #2037422 \u003chttps://bugs.launchpad.net/manila/+bug/2037422\u003e`_"},{"line_number":7,"context_line":"    for more details."}],"source_content_type":"text/x-yaml","patch_set":1,"id":"e756c9d3_1fe980e6","line":4,"range":{"start_line":4,"start_character":35,"end_line":4,"end_character":36},"updated":"2023-10-07 00:20:31.000000000","message":"now","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"},{"author":{"_account_id":32919,"name":"kiran pawar","display_name":"Kiran Pawar","email":"kinpaa@gmail.com","username":"kpdev"},"change_message_id":"22d1ef195098286434f2a87e42409cb4182dc142","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"fixes:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Default share network subnet is deleted when share network is deleted, in"},{"line_number":5,"context_line":"    case it is the only subnet present in share network. Please refer to the"},{"line_number":6,"context_line":"    `Launchpad bug #2037422 \u003chttps://bugs.launchpad.net/manila/+bug/2037422\u003e`_"},{"line_number":7,"context_line":"    for more details."}],"source_content_type":"text/x-yaml","patch_set":1,"id":"dd467374_018863a3","line":4,"range":{"start_line":4,"start_character":35,"end_line":4,"end_character":36},"in_reply_to":"e756c9d3_1fe980e6","updated":"2023-10-09 13:08:55.000000000","message":"Done","commit_id":"c76a017f454076d33da00223a1f732a305a0c97d"}]}
