)]}'
{"oslo_config/migrator.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"970f901fade00c3074d20a0f8ebba402768c581e","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_2739f9ef","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"updated":"2018-10-02 18:24:20.000000000","message":"I wonder if we want to make this a list of values for handling the M-\u003eN case. I realize the current code can\u0027t do that yet, but I think it wouldn\u0027t be that hard to implement if we define the callback API to take a list in the first place. Then it won\u0027t require any breaking changes when we do support it.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"79db92ededa15536b53b7bc7f68d23a7bd48c3f6","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_8a355bf8","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_24b33050","updated":"2018-10-03 17:23:56.000000000","message":"Oh, you\u0027re right. That\u0027s not the case I was thinking about.\n\nFor the case you\u0027re referring to I think you\u0027re right that we should just drop the type handling here and leave it on the converter to do that. They probably know what type the option is anyway.\n\nI was thinking about the transport_url case where multiple old values go into a single new one. If the callback only supports a single old value I\u0027m not sure how we would implement that. On the other hand, after some more thought I don\u0027t think a simple list is enough to handle that case anyway. You would need a dict so you know which option the old value came from.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"1f6abe39f97109792d7bc2c9eda81faf0a05815d","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_38303607","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_2739f9ef","updated":"2018-10-02 21:00:22.000000000","message":"So that\u0027s the case where maybe we want to convert [a, b, c] to [d, e]? Where there\u0027s not a 1:1 corresponding conversion?","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"d9539ec1bd7580e593bb57bf3bc1b3f1fbaf9cc9","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_9e3b7399","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_38303607","updated":"2018-10-02 21:18:43.000000000","message":"I _think_ what you\u0027d have to do in that case is make a, b, and c deprecated_opts on both d and e, then this would get called for d and e with [a, b, c] in both cases and the function (or more likely functions) would do whatever it needed to with those values.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"c899821ed1e15ed0414cccab2475b6db0277140d","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3a1b321c","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_8a355bf8","updated":"2018-10-03 19:00:56.000000000","message":"Done","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"19f73d014cbb67d28f2a7fd8a8eda735d9a81b61","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_c8ea5f9f","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_8a355bf8","updated":"2018-10-04 18:03:59.000000000","message":"I pushed a followup PoC to demonstrate what I meant about the dict: https://review.openstack.org/#/c/608047","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"3bf99168bd685719084d2f555f7f5650578a789c","unresolved":false,"context_lines":[{"line_number":167,"context_line":"            name][\u0027opt\u0027].default \u003d value"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"def _upgrade_value(converter, option, old_value):"},{"line_number":171,"context_line":"    if not converter:"},{"line_number":172,"context_line":"        return old_value"},{"line_number":173,"context_line":"    if isinstance(old_value, list):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_24b33050","line":170,"range":{"start_line":170,"start_character":38,"end_line":170,"end_character":47},"in_reply_to":"3f79a3b5_9e3b7399","updated":"2018-10-02 22:21:13.000000000","message":"I think we\u0027re talking about separate things.\n\nI was talking about a case where the value of a single option is a list, and the list contains [a, b, c] under the old format but should be converted to [d, e]. In that case the old_value argument here will already be a list, but the converter will be called for each of a, b, and c in order.\n\nThat type of conversion won\u0027t be handled by the current implementation and your comment made me think that we should remove lines 173-178 and just have the single converter call that is now on line 179.\n\nIs that what you meant?","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"}],"oslo_config/tests/test_migrator.py":[{"author":{"_account_id":28278,"name":"Duc Nguyen","email":"ducnv41@viettel.com.vn","username":"ducnv"},"change_message_id":"28db4bf8d822f147df27164653c7b6ede369f60d","unresolved":false,"context_lines":[{"line_number":417,"context_line":"}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def choice_opt_converter(opt, value):"},{"line_number":421,"context_line":"    return {"},{"line_number":422,"context_line":"        \u0027a\u0027: \u0027a_update\u0027,"},{"line_number":423,"context_line":"        \u0027b\u0027: \u0027b_update\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_cbfb80bc","line":420,"range":{"start_line":420,"start_character":4,"end_line":420,"end_character":37},"updated":"2018-10-02 08:19:18.000000000","message":"I wonder if this should be:\nchoice_opt_converter(value)","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"970f901fade00c3074d20a0f8ebba402768c581e","unresolved":false,"context_lines":[{"line_number":417,"context_line":"}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def choice_opt_converter(opt, value):"},{"line_number":421,"context_line":"    return {"},{"line_number":422,"context_line":"        \u0027a\u0027: \u0027a_update\u0027,"},{"line_number":423,"context_line":"        \u0027b\u0027: \u0027b_update\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_67337114","line":420,"range":{"start_line":420,"start_character":4,"end_line":420,"end_character":37},"in_reply_to":"3f79a3b5_3b303b9e","updated":"2018-10-02 18:24:20.000000000","message":"I guess the question is whether it needs to be. I\u0027m trying to come up with a case where you would need to look at the new opt definition in order to do the mapping. Maybe if you wanted to implement a single mapping function for an entire project that looked at the new opt to determine what to do with the old value?","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"1f6abe39f97109792d7bc2c9eda81faf0a05815d","unresolved":false,"context_lines":[{"line_number":417,"context_line":"}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def choice_opt_converter(opt, value):"},{"line_number":421,"context_line":"    return {"},{"line_number":422,"context_line":"        \u0027a\u0027: \u0027a_update\u0027,"},{"line_number":423,"context_line":"        \u0027b\u0027: \u0027b_update\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_98fdca0a","line":420,"range":{"start_line":420,"start_character":4,"end_line":420,"end_character":37},"in_reply_to":"3f79a3b5_67337114","updated":"2018-10-02 21:00:22.000000000","message":"Yeah, I was trying to anticipate things that might be useful ever but would be hard to add later because it would change the API of the callback. The case you propose is one, but I think as a reviewer I would ask for that function to be broken up. A more generic thing that converts driver setting values from the old package.module.class form to the entry point name might be one where a somewhat generic function could be written but it would need to know what the valid choices are.\n\nSo I don\u0027t know. It might never be useful, but if it ever *is* useful then we have to write some much more complicated callback invocation code to support it if we don\u0027t just add it from the beginning. I don\u0027t feel that strongly about it, so let me know if I should simplify it for now.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"d9539ec1bd7580e593bb57bf3bc1b3f1fbaf9cc9","unresolved":false,"context_lines":[{"line_number":417,"context_line":"}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def choice_opt_converter(opt, value):"},{"line_number":421,"context_line":"    return {"},{"line_number":422,"context_line":"        \u0027a\u0027: \u0027a_update\u0027,"},{"line_number":423,"context_line":"        \u0027b\u0027: \u0027b_update\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_1efd23b1","line":420,"range":{"start_line":420,"start_character":4,"end_line":420,"end_character":37},"in_reply_to":"3f79a3b5_98fdca0a","updated":"2018-10-02 21:18:43.000000000","message":"I\u0027m okay with it staying. The fact that I can\u0027t come up with a good use case doesn\u0027t mean one doesn\u0027t exist, and we already have the opt definition available when we call this function so it costs us basically nothing to pass it in. And as you noted, it saves us a lot of grief down the line if someone does come up with a use for it.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"b8f9c6246d68e2913399e9e7748f865286ac2ed5","unresolved":false,"context_lines":[{"line_number":417,"context_line":"}"},{"line_number":418,"context_line":""},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"def choice_opt_converter(opt, value):"},{"line_number":421,"context_line":"    return {"},{"line_number":422,"context_line":"        \u0027a\u0027: \u0027a_update\u0027,"},{"line_number":423,"context_line":"        \u0027b\u0027: \u0027b_update\u0027,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_3b303b9e","line":420,"range":{"start_line":420,"start_character":4,"end_line":420,"end_character":37},"in_reply_to":"3f79a3b5_cbfb80bc","updated":"2018-10-02 13:42:14.000000000","message":"The Opt instance is passed to the converter as the first argument.","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"},{"author":{"_account_id":28278,"name":"Duc Nguyen","email":"ducnv41@viettel.com.vn","username":"ducnv"},"change_message_id":"28db4bf8d822f147df27164653c7b6ede369f60d","unresolved":false,"context_lines":[{"line_number":485,"context_line":"        \u0027choices_opt\u0027: cfg.StrOpt(\u0027choices_opt\u0027,"},{"line_number":486,"context_line":"                                  deprecated_name\u003d\u0027deprecated_choices_opt\u0027,"},{"line_number":487,"context_line":"                                  deprecated_group\u003d\u0027group1\u0027,"},{"line_number":488,"context_line":"                                  choices\u003d(\u0027a_update\u0027, \u0027b_update\u0027, \u0027c_update\u0027,"},{"line_number":489,"context_line":"                                           \u0027a\u0027, \u0027b\u0027, \u0027c\u0027),"},{"line_number":490,"context_line":"                                  convert_on_upgrade\u003dchoice_opt_converter,"},{"line_number":491,"context_line":"                                  help\u003d\u0027This option is to replace \u0027"},{"line_number":492,"context_line":"                                       \u0027deprecated_choices_opt\u0027),"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f79a3b5_cb2e208c","line":489,"range":{"start_line":488,"start_character":34,"end_line":489,"end_character":58},"updated":"2018-10-02 08:19:18.000000000","message":"follows Ben\u0027s comment: a, b, c shouldn\u0027t be choices on the option. I fixed this with follow-up patch. Please take a look at it https://review.openstack.org/#/c/603060/3","commit_id":"1f4c5e58e05d47513509f0e434c239fd1cc3a0a2"}]}
