)]}'
{"neutron_lib/placement/client.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d5c33aaaee3f861e02c5f0ef08bfe914b8e3c3ed","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        if exception_to_reraise:"},{"line_number":528,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":529,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":530,"context_line":"                generation\u003dinventory[\u0027resource_provider_generation\u0027])"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"    @_check_placement_api_available"},{"line_number":533,"context_line":"    def associate_aggregates(self, resource_provider_uuid, aggregates):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_b1f9ba80","line":530,"updated":"2019-11-21 13:34:21.000000000","message":"whole this block from lines 503-530 is exactly the same as in lines 373-401. Maybe You could extract it to new helper function like \"_try_put()\" or something like that to avoid code duplication?\nMaybe only handling of ks_exc.NotFound exception is different but that could be not moved to this common function and stay here.","commit_id":"21cafde29f06b05f0c7620bbb2cb7191bdcb4090"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"9324936223a1dba1662619bffa956ce7c00ceed9","unresolved":false,"context_lines":[{"line_number":527,"context_line":"        if exception_to_reraise:"},{"line_number":528,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":529,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":530,"context_line":"                generation\u003dinventory[\u0027resource_provider_generation\u0027])"},{"line_number":531,"context_line":""},{"line_number":532,"context_line":"    @_check_placement_api_available"},{"line_number":533,"context_line":"    def associate_aggregates(self, resource_provider_uuid, aggregates):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_15273014","line":530,"in_reply_to":"3fa7e38b_b1f9ba80","updated":"2019-11-27 14:56:36.000000000","message":"Done","commit_id":"21cafde29f06b05f0c7620bbb2cb7191bdcb4090"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"d5c33aaaee3f861e02c5f0ef08bfe914b8e3c3ed","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        if exception_to_reraise:"},{"line_number":665,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":666,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":667,"context_line":"                generation\u003dbody[\u0027resource_provider_generation\u0027])"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @_check_placement_api_available"},{"line_number":670,"context_line":"    def list_resource_provider_traits(self, resource_provider_uuid):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_512e46fa","line":667,"updated":"2019-11-21 13:34:21.000000000","message":"and here it is also the same","commit_id":"21cafde29f06b05f0c7620bbb2cb7191bdcb4090"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"9324936223a1dba1662619bffa956ce7c00ceed9","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        if exception_to_reraise:"},{"line_number":665,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":666,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":667,"context_line":"                generation\u003dbody[\u0027resource_provider_generation\u0027])"},{"line_number":668,"context_line":""},{"line_number":669,"context_line":"    @_check_placement_api_available"},{"line_number":670,"context_line":"    def list_resource_provider_traits(self, resource_provider_uuid):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_f54ff488","line":667,"in_reply_to":"3fa7e38b_512e46fa","updated":"2019-11-27 14:56:36.000000000","message":"Done","commit_id":"21cafde29f06b05f0c7620bbb2cb7191bdcb4090"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"a6ad969a50aac95d4cd3d94ccf73abbe9818af4c","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if resource_provider_generation is None:"},{"line_number":206,"context_line":"            # If the client\u0027s user did not supply a generation to us we dare to"},{"line_number":207,"context_line":"            # retry without handing the control back to our caller."},{"line_number":208,"context_line":"            max_tries \u003d 10"},{"line_number":209,"context_line":"        else:"},{"line_number":210,"context_line":"            # If the client\u0027s user supplied a generation to us we don\u0027t dare to"},{"line_number":211,"context_line":"            # retry on her behalf since we don\u0027t know her intention."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_0037b000","line":208,"range":{"start_line":208,"start_character":12,"end_line":208,"end_character":26},"updated":"2019-11-29 08:15:45.000000000","message":"nit: this 10 seems to be magic :-)\nBut I can\u0027t see any good config option to use here for example.","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"6b5c10a52b8f70833b81f700e4958f00989eb0b9","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if resource_provider_generation is None:"},{"line_number":206,"context_line":"            # If the client\u0027s user did not supply a generation to us we dare to"},{"line_number":207,"context_line":"            # retry without handing the control back to our caller."},{"line_number":208,"context_line":"            max_tries \u003d 10"},{"line_number":209,"context_line":"        else:"},{"line_number":210,"context_line":"            # If the client\u0027s user supplied a generation to us we don\u0027t dare to"},{"line_number":211,"context_line":"            # retry on her behalf since we don\u0027t know her intention."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_9cc3c739","line":208,"range":{"start_line":208,"start_character":12,"end_line":208,"end_character":26},"in_reply_to":"3fa7e38b_0037b000","updated":"2019-12-04 18:44:06.000000000","message":"Same comment. At least, as in other libraries, this should be on top of this file as a constant.","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"718ed41a8b94f570c5a7578cf3b1887e9c557c0b","unresolved":false,"context_lines":[{"line_number":205,"context_line":"        if resource_provider_generation is None:"},{"line_number":206,"context_line":"            # If the client\u0027s user did not supply a generation to us we dare to"},{"line_number":207,"context_line":"            # retry without handing the control back to our caller."},{"line_number":208,"context_line":"            max_tries \u003d 10"},{"line_number":209,"context_line":"        else:"},{"line_number":210,"context_line":"            # If the client\u0027s user supplied a generation to us we don\u0027t dare to"},{"line_number":211,"context_line":"            # retry on her behalf since we don\u0027t know her intention."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_1cbd4d67","line":208,"range":{"start_line":208,"start_character":12,"end_line":208,"end_character":26},"in_reply_to":"3fa7e38b_9cc3c739","updated":"2019-12-11 12:40:46.000000000","message":"Done","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":8313,"name":"Lajos Katona","display_name":"lajoskatona","email":"katonalala@gmail.com","username":"elajkat","status":"Ericsson Software Technology"},"change_message_id":"a6ad969a50aac95d4cd3d94ccf73abbe9818af4c","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            try:"},{"line_number":229,"context_line":"                return self._put(url, body).json()"},{"line_number":230,"context_line":"            except ks_exc.Conflict as e:"},{"line_number":231,"context_line":"                exception_to_reraise \u003d e"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        if exception_to_reraise:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_60322412","line":231,"range":{"start_line":231,"start_character":16,"end_line":231,"end_character":40},"updated":"2019-11-29 08:15:45.000000000","message":"nit: as you never check the contents of exception_to_reraise and raise PlacementResourceProviderGenerationConflict, it should be True or False.","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"718ed41a8b94f570c5a7578cf3b1887e9c557c0b","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            try:"},{"line_number":229,"context_line":"                return self._put(url, body).json()"},{"line_number":230,"context_line":"            except ks_exc.Conflict as e:"},{"line_number":231,"context_line":"                exception_to_reraise \u003d e"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        if exception_to_reraise:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_9c5e1d43","line":231,"range":{"start_line":231,"start_character":16,"end_line":231,"end_character":40},"in_reply_to":"3fa7e38b_5cd22fff","updated":"2019-12-11 12:40:46.000000000","message":"Done","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"6b5c10a52b8f70833b81f700e4958f00989eb0b9","unresolved":false,"context_lines":[{"line_number":228,"context_line":"            try:"},{"line_number":229,"context_line":"                return self._put(url, body).json()"},{"line_number":230,"context_line":"            except ks_exc.Conflict as e:"},{"line_number":231,"context_line":"                exception_to_reraise \u003d e"},{"line_number":232,"context_line":"                continue"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        if exception_to_reraise:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_5cd22fff","line":231,"range":{"start_line":231,"start_character":16,"end_line":231,"end_character":40},"in_reply_to":"3fa7e38b_60322412","updated":"2019-12-04 18:44:06.000000000","message":"+1","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"6b5c10a52b8f70833b81f700e4958f00989eb0b9","unresolved":false,"context_lines":[{"line_number":505,"context_line":"                                             provider. Optional."},{"line_number":506,"context_line":"        :raises PlacementResourceNotFound: If the resource provider or the"},{"line_number":507,"context_line":"                                           resource class is not found."},{"line_number":508,"context_line":"        :raises PlacementResourceProviderGenerationConflict: If the resource"},{"line_number":509,"context_line":"                                                             provider"},{"line_number":510,"context_line":"                                                             generation does"},{"line_number":511,"context_line":"                                                             not match with the"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_3cf09391","line":508,"range":{"start_line":508,"start_character":16,"end_line":508,"end_character":59},"updated":"2019-12-04 18:44:06.000000000","message":"Be careful: we are not throwing \"PlacementInventoryUpdateConflict\" anymore. [1] will fail now\n\nhttps://github.com/openstack/neutron/blob/97e495671f5746d7a0e54a7cd67fc5baf7669813/neutron/services/segments/plugin.py#L227","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"718ed41a8b94f570c5a7578cf3b1887e9c557c0b","unresolved":false,"context_lines":[{"line_number":505,"context_line":"                                             provider. Optional."},{"line_number":506,"context_line":"        :raises PlacementResourceNotFound: If the resource provider or the"},{"line_number":507,"context_line":"                                           resource class is not found."},{"line_number":508,"context_line":"        :raises PlacementResourceProviderGenerationConflict: If the resource"},{"line_number":509,"context_line":"                                                             provider"},{"line_number":510,"context_line":"                                                             generation does"},{"line_number":511,"context_line":"                                                             not match with the"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_5c298599","line":508,"range":{"start_line":508,"start_character":16,"end_line":508,"end_character":59},"in_reply_to":"3fa7e38b_3cf09391","updated":"2019-12-11 12:40:46.000000000","message":"Nice catch. Here\u0027s the followup neutron change:\n\nhttps://review.opendev.org/698261","commit_id":"1b6dd122b4b59135c416ddf07161eed87c5d6e63"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"4f81113dbc743aea323a933790caf1d37bd7985a","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                reraise \u003d True"},{"line_number":233,"context_line":"                continue"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        if reraise:"},{"line_number":236,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":237,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":238,"context_line":"                generation\u003dbody[\u0027resource_provider_generation\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_8ea6830d","line":235,"updated":"2019-12-17 09:14:09.000000000","message":"in fact I now wonder how we can end up with case when reraise \u003d\u003d False here and I think that we simply can\u0027t.\nIf _put() in L230 will end up with success we will simply return there and never get to this line. If it will raise conflict all the time than finally we will get here and will always have to raise this exception. There is no other way to miss return from L230 and get here. Am I missing something?","commit_id":"c31583553c363c615dae93d25b57c4bc01633590"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"0548ad93a97aa9f3be4b0c3ac872aaf73120b98e","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                reraise \u003d True"},{"line_number":233,"context_line":"                continue"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        if reraise:"},{"line_number":236,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":237,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":238,"context_line":"                generation\u003dbody[\u0027resource_provider_generation\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_cc88dc22","line":235,"in_reply_to":"3fa7e38b_71cbe64a","updated":"2019-12-19 09:48:35.000000000","message":"Done","commit_id":"c31583553c363c615dae93d25b57c4bc01633590"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"45763ec2b9a5ac3fa5425349fa3e47dbfc680412","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                reraise \u003d True"},{"line_number":233,"context_line":"                continue"},{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        if reraise:"},{"line_number":236,"context_line":"            raise n_exc.PlacementResourceProviderGenerationConflict("},{"line_number":237,"context_line":"                resource_provider\u003dresource_provider_uuid,"},{"line_number":238,"context_line":"                generation\u003dbody[\u0027resource_provider_generation\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_71cbe64a","line":235,"in_reply_to":"3fa7e38b_8ea6830d","updated":"2019-12-17 10:47:02.000000000","message":"You are right, \"reraise\" is not necessary. If we reach this line (the code did not return in L230), that means we must raise \"PlacementResourceProviderGenerationConflict\".","commit_id":"c31583553c363c615dae93d25b57c4bc01633590"},{"author":{"_account_id":27654,"name":"Hongbin Lu","email":"kira034@163.com","username":"hongbin.lu"},"change_message_id":"7399d47494e61b66f2ec6510a06ea7f76a6ae943","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                            \u0027generation\u0027]"},{"line_number":228,"context_line":"            try:"},{"line_number":229,"context_line":"                return self._put(url, body).json()"},{"line_number":230,"context_line":"            except ks_exc.Conflict:"},{"line_number":231,"context_line":"                continue"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        raise n_exc.PlacementResourceProviderGenerationConflict("}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_c5aad4d1","line":230,"range":{"start_line":230,"start_character":26,"end_line":230,"end_character":34},"updated":"2019-12-20 22:08:26.000000000","message":"Quote from placement api reference [1]:\n\n  A mismatch indicates that a different request successfully updated that entity in the interim, thereby changing its generation. This will result in an HTTP 409 Conflict response with error code placement.concurrent_update.\n\nTherefore, I would suggest to check the error code as well. We should retry only if the error code is \u0027placement.concurrent_update\u0027. What do you think?\n\n[1] https://docs.openstack.org/api-ref/placement/#resource-provider-and-consumer-generations","commit_id":"50e8c257cf1c330b3b0d28da0e7873595452593e"},{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"working for Ericsson, UTC+1 (+DST)"},"change_message_id":"420b5d6820c8ad5365548f864f72d41b53ee8e10","unresolved":false,"context_lines":[{"line_number":227,"context_line":"                            \u0027generation\u0027]"},{"line_number":228,"context_line":"            try:"},{"line_number":229,"context_line":"                return self._put(url, body).json()"},{"line_number":230,"context_line":"            except ks_exc.Conflict:"},{"line_number":231,"context_line":"                continue"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        raise n_exc.PlacementResourceProviderGenerationConflict("}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_a2d1c4cc","line":230,"range":{"start_line":230,"start_character":26,"end_line":230,"end_character":34},"in_reply_to":"3fa7e38b_c5aad4d1","updated":"2019-12-23 11:05:23.000000000","message":"I had to bump the placement microversion to 1.23 because only from that version we have the code in the error response. 1.23 was released in Rocky just as well as the previously used 1.20, so I hope that\u0027s not an upgrade problem.","commit_id":"50e8c257cf1c330b3b0d28da0e7873595452593e"}]}
