)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":32177,"name":"Jacob Anders","email":"jacob-anders-dev@proton.me","username":"janders"},"change_message_id":"2752e38627c2fc69d85b83039e21b22f4762d8b8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"f1ea30be_86f30b07","updated":"2023-07-11 10:15:31.000000000","message":"Thank you for your review Dmitry. I have one follow-up question in-line to make sure I got it right before re-writing the patch.","commit_id":"72cec8ebea0974032df6556bbe3a824d632539f0"}],"ironic/drivers/modules/redfish/boot.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fb982f4939a9f213e093dffbb555c89538e6c1a0","unresolved":true,"context_lines":[{"line_number":218,"context_line":"    # presence of a sushy.VIRTUAL_MEDIA_DVD device. If the request was made"},{"line_number":219,"context_line":"    # to boot off sushy.VIRTUAL_MEDIA_CD and there is no CD but there is a DVD"},{"line_number":220,"context_line":"    # try it before failing out"},{"line_number":221,"context_line":"    # Walking all the media types across all the vmedia devices across all"},{"line_number":222,"context_line":"    # managers the second time, hoping to utilize caching"},{"line_number":223,"context_line":"    for manager in managers:"},{"line_number":224,"context_line":"        for v_media in manager.virtual_media.get_members():"},{"line_number":225,"context_line":"            if boot_device not in v_media.media_types:"}],"source_content_type":"text/x-python","patch_set":2,"id":"16b34873_69b5e98f","line":222,"range":{"start_line":221,"start_character":0,"end_line":222,"end_character":57},"updated":"2023-07-05 12:20:03.000000000","message":"We can err on the side of caution and prepare a list of virtual media devices once in the beginning of the function.","commit_id":"72cec8ebea0974032df6556bbe3a824d632539f0"},{"author":{"_account_id":32177,"name":"Jacob Anders","email":"jacob-anders-dev@proton.me","username":"janders"},"change_message_id":"2752e38627c2fc69d85b83039e21b22f4762d8b8","unresolved":true,"context_lines":[{"line_number":218,"context_line":"    # presence of a sushy.VIRTUAL_MEDIA_DVD device. If the request was made"},{"line_number":219,"context_line":"    # to boot off sushy.VIRTUAL_MEDIA_CD and there is no CD but there is a DVD"},{"line_number":220,"context_line":"    # try it before failing out"},{"line_number":221,"context_line":"    # Walking all the media types across all the vmedia devices across all"},{"line_number":222,"context_line":"    # managers the second time, hoping to utilize caching"},{"line_number":223,"context_line":"    for manager in managers:"},{"line_number":224,"context_line":"        for v_media in manager.virtual_media.get_members():"},{"line_number":225,"context_line":"            if boot_device not in v_media.media_types:"}],"source_content_type":"text/x-python","patch_set":2,"id":"a6aafff0_dca7371e","line":222,"range":{"start_line":221,"start_character":0,"end_line":222,"end_character":57},"in_reply_to":"16b34873_69b5e98f","updated":"2023-07-11 10:15:31.000000000","message":"Thank you for the suggestion Dmitry. So - to make sure I got this right - should I do something like this in https://opendev.org/openstack/ironic/src/branch/master/ironic/drivers/modules/redfish/boot.py#L186:\n\n(...)\n186     vmedia_list \u003d []\n187     for manager in managers:\n188         for v_media in manager.virtual_media.get_members():\n189             vmedia_list[manager].append(v_media)\n190             if boot_device not in v_media.media_types:\n191                 continue\n(...)","commit_id":"72cec8ebea0974032df6556bbe3a824d632539f0"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fb982f4939a9f213e093dffbb555c89538e6c1a0","unresolved":true,"context_lines":[{"line_number":223,"context_line":"    for manager in managers:"},{"line_number":224,"context_line":"        for v_media in manager.virtual_media.get_members():"},{"line_number":225,"context_line":"            if boot_device not in v_media.media_types:"},{"line_number":226,"context_line":"                if (boot_device \u003d\u003d sushy.VIRTUAL_MEDIA_CD"},{"line_number":227,"context_line":"                    and sushy.VIRTUAL_MEDIA_DVD in v_media.media_types):"},{"line_number":228,"context_line":"                    LOG.debug(\"Requested boot from \", sushy.VIRTUAL_MEDIA_CD,"},{"line_number":229,"context_line":"                              \" but only \", sushy.VIRTUAL_MEDIA_DVD,"}],"source_content_type":"text/x-python","patch_set":2,"id":"64e3f9bf_8ec01daa","line":226,"updated":"2023-07-05 12:20:03.000000000","message":"This \u0027if\u0027 block should be outside of the loops to avoid looping for non-CD devices.","commit_id":"72cec8ebea0974032df6556bbe3a824d632539f0"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fb982f4939a9f213e093dffbb555c89538e6c1a0","unresolved":true,"context_lines":[{"line_number":228,"context_line":"                    LOG.debug(\"Requested boot from \", sushy.VIRTUAL_MEDIA_CD,"},{"line_number":229,"context_line":"                              \" but only \", sushy.VIRTUAL_MEDIA_DVD,"},{"line_number":230,"context_line":"                              \" is available. Falling back to \","},{"line_number":231,"context_line":"                              sushy.VIRTUAL_MEDIA_DVD)"},{"line_number":232,"context_line":"                else:"},{"line_number":233,"context_line":"                    continue"},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"d03a1962_ff2e5999","line":231,"updated":"2023-07-05 12:20:03.000000000","message":"Nothing happens after this line. You need to move lines 191-207 around. Maybe actually extract\n\n def _try_insert_image(task, v_media, boot_url) -\u003e bool:\n \nwhich returns True on success, False if the device is occupied and raises an error otherwise. Then you can reuse it in both loops.","commit_id":"72cec8ebea0974032df6556bbe3a824d632539f0"}]}
