)]}'
{"ironic_python_agent/extensions/image.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Actually any fat partition could be a candidate. Let\u0027s assume the"},{"line_number":188,"context_line":"    # partition also has the esp flag"},{"line_number":189,"context_line":"    if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_75634b1a","line":189,"updated":"2020-01-23 10:02:14.000000000","message":"nit: split the whole branch into another function?","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":186,"context_line":""},{"line_number":187,"context_line":"    # Actually any fat partition could be a candidate. Let\u0027s assume the"},{"line_number":188,"context_line":"    # partition also has the esp flag"},{"line_number":189,"context_line":"    if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_4704be13","line":189,"in_reply_to":"3fa7e38b_75634b1a","updated":"2020-02-21 11:25:06.000000000","message":"I think given the size this would be sensible, even for the other if branch. Can we leave this for a follow-up, though?","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":189,"context_line":"    if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""},{"line_number":193,"context_line":"                      \"partition located on softraid %s to be relocated\","},{"line_number":194,"context_line":"                      device)"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_1564571f","line":192,"updated":"2020-01-23 10:02:14.000000000","message":"nit: EFI? (ditto below)","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":189,"context_line":"    if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""},{"line_number":193,"context_line":"                      \"partition located on softraid %s to be relocated\","},{"line_number":194,"context_line":"                      device)"},{"line_number":195,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_04c48438","line":192,"in_reply_to":"3fa7e38b_1564571f","updated":"2020-02-21 11:25:06.000000000","message":"Done","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""},{"line_number":193,"context_line":"                      \"partition located on softraid %s to be relocated\","},{"line_number":194,"context_line":"                      device)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            # NOTE: for whole disk images, no efi part uuid will be provided."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_356953f6","line":193,"updated":"2020-01-23 10:02:14.000000000","message":"nit: \"software RAID device\"","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":190,"context_line":"        if not efi_part:"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            LOG.debug(\"No explicit efi part provided. Scanning for any efi \""},{"line_number":193,"context_line":"                      \"partition located on softraid %s to be relocated\","},{"line_number":194,"context_line":"                      device)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            # NOTE: for whole disk images, no efi part uuid will be provided."}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_a4d250fd","line":193,"in_reply_to":"3fa7e38b_356953f6","updated":"2020-02-21 11:25:06.000000000","message":"Done","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            if efi_part:"},{"line_number":202,"context_line":"                efi_part \u003d \u0027{}p{}\u0027.format(device, efi_part)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # We know that we let this space when configuring raid see"},{"line_number":205,"context_line":"        # hardware.GenericHardwareManager.create_configuration"},{"line_number":206,"context_line":"        # We could also directly get the efi part size"},{"line_number":207,"context_line":"        partsize_mib \u003d 128"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_d571dfe0","line":204,"updated":"2020-01-23 10:02:14.000000000","message":"nit: s/let/left/ ?","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":201,"context_line":"            if efi_part:"},{"line_number":202,"context_line":"                efi_part \u003d \u0027{}p{}\u0027.format(device, efi_part)"},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"        # We know that we let this space when configuring raid see"},{"line_number":205,"context_line":"        # hardware.GenericHardwareManager.create_configuration"},{"line_number":206,"context_line":"        # We could also directly get the efi part size"},{"line_number":207,"context_line":"        partsize_mib \u003d 128"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_64fe986e","line":204,"in_reply_to":"3fa7e38b_d571dfe0","updated":"2020-02-21 11:25:06.000000000","message":"Done","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":235,"context_line":"                LOG.debug(\"Relocating efi %s to holder part %s\", efi_part,"},{"line_number":236,"context_line":"                          target_part)"},{"line_number":237,"context_line":"                # Blockdev copy"},{"line_number":238,"context_line":"                utils.execute(\"cp\", efi_part, target_part)"},{"line_number":239,"context_line":"            else:"},{"line_number":240,"context_line":"                # Creating a label is just to make life easier"},{"line_number":241,"context_line":"                if number \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_f56e5bfc","line":238,"updated":"2020-01-23 10:02:14.000000000","message":"cp works with devices? Oo I would expect dd to be used here..","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":235,"context_line":"                LOG.debug(\"Relocating efi %s to holder part %s\", efi_part,"},{"line_number":236,"context_line":"                          target_part)"},{"line_number":237,"context_line":"                # Blockdev copy"},{"line_number":238,"context_line":"                utils.execute(\"cp\", efi_part, target_part)"},{"line_number":239,"context_line":"            else:"},{"line_number":240,"context_line":"                # Creating a label is just to make life easier"},{"line_number":241,"context_line":"                if number \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_6423f813","line":238,"in_reply_to":"3fa7e38b_f56e5bfc","updated":"2020-02-21 11:25:06.000000000","message":"I didn\u0027t know either, but it seems underneath both are doing the very same thing/using the same functions. Seems ok :)","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        # FIXME(rg): prep boot part uuid not handled"},{"line_number":308,"context_line":"        efi_partitions \u003d _prepare_boot_partitions_for_softraid("},{"line_number":309,"context_line":"            device, holders, efi_part, target_boot_mode"},{"line_number":310,"context_line":"        )"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    try:"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_9577e7d2","line":310,"updated":"2020-01-23 10:02:14.000000000","message":"nit: handle exceptions and re-raise with more context? Like \"Failed to prepare boot partitions for software RAID device %(dev)s: %(error)s\"","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":307,"context_line":"        # FIXME(rg): prep boot part uuid not handled"},{"line_number":308,"context_line":"        efi_partitions \u003d _prepare_boot_partitions_for_softraid("},{"line_number":309,"context_line":"            device, holders, efi_part, target_boot_mode"},{"line_number":310,"context_line":"        )"},{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    try:"},{"line_number":313,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_440fdc37","line":310,"in_reply_to":"3fa7e38b_9577e7d2","updated":"2020-02-21 11:25:06.000000000","message":"I moved the try up, which is what was done is master as well. We can refine this if we think this is needed.","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"fedf9a6bd1fe143b55126201b8159661fc4918d3","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        # Add /usr/sbin to PATH variable to ensure it is there as we do"},{"line_number":341,"context_line":"        # not use full path to grub binary anymore."},{"line_number":342,"context_line":"        path_variable \u003d os.environ.get(\u0027PATH\u0027, \u0027\u0027)"},{"line_number":343,"context_line":"        path_variable \u003d \u0027%s:/bin:/usr/sbin\u0027 % path_variable"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        if efi_partitions:"},{"line_number":346,"context_line":"            if not os.path.exists(efi_partition_mount_point):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_13ba93b9","line":343,"range":{"start_line":343,"start_character":8,"end_line":343,"end_character":59},"updated":"2020-02-04 17:37:01.000000000","message":"It seems that my image had mdadm in /sbin, could that be added to path_variable?","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"35ff868d1e49297d7a3b3b439ebb6ff05ab37928","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        # Add /usr/sbin to PATH variable to ensure it is there as we do"},{"line_number":341,"context_line":"        # not use full path to grub binary anymore."},{"line_number":342,"context_line":"        path_variable \u003d os.environ.get(\u0027PATH\u0027, \u0027\u0027)"},{"line_number":343,"context_line":"        path_variable \u003d \u0027%s:/bin:/usr/sbin\u0027 % path_variable"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        if efi_partitions:"},{"line_number":346,"context_line":"            if not os.path.exists(efi_partition_mount_point):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_f85d4717","line":343,"range":{"start_line":343,"start_character":8,"end_line":343,"end_character":59},"in_reply_to":"3fa7e38b_12ecc226","updated":"2020-02-05 12:22:08.000000000","message":"It might be that this a red herring: I was debugging this, tried things manually and it seemed that it broke b/c of /sbin missing ... let me remove that bit and retry ...","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":23851,"name":"Riccardo Pittau","email":"elfosardo@gmail.com","username":"elfosardo"},"change_message_id":"df286d85a4fff6d48d98b1697a7fde440caf5f8e","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        # Add /usr/sbin to PATH variable to ensure it is there as we do"},{"line_number":341,"context_line":"        # not use full path to grub binary anymore."},{"line_number":342,"context_line":"        path_variable \u003d os.environ.get(\u0027PATH\u0027, \u0027\u0027)"},{"line_number":343,"context_line":"        path_variable \u003d \u0027%s:/bin:/usr/sbin\u0027 % path_variable"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        if efi_partitions:"},{"line_number":346,"context_line":"            if not os.path.exists(efi_partition_mount_point):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_12ecc226","line":343,"range":{"start_line":343,"start_character":8,"end_line":343,"end_character":59},"in_reply_to":"3fa7e38b_13ba93b9","updated":"2020-02-05 10:22:57.000000000","message":"just a note, I think we run all of this as root user, /sbin should always be included in its default PATH as best practice.\nWith that said, I agree in adding it here (better safe than sorry), but then also the tests need to change as they\u0027re assuming /sbin as default PATH.\nWe might consider doing this in a follow-up.","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"95e8ccb8483e4b3333b42b94b2645e6d2f5406c6","unresolved":false,"context_lines":[{"line_number":340,"context_line":"        # Add /usr/sbin to PATH variable to ensure it is there as we do"},{"line_number":341,"context_line":"        # not use full path to grub binary anymore."},{"line_number":342,"context_line":"        path_variable \u003d os.environ.get(\u0027PATH\u0027, \u0027\u0027)"},{"line_number":343,"context_line":"        path_variable \u003d \u0027%s:/bin:/usr/sbin\u0027 % path_variable"},{"line_number":344,"context_line":""},{"line_number":345,"context_line":"        if efi_partitions:"},{"line_number":346,"context_line":"            if not os.path.exists(efi_partition_mount_point):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_e405a817","line":343,"range":{"start_line":343,"start_character":8,"end_line":343,"end_character":59},"in_reply_to":"3fa7e38b_f85d4717","updated":"2020-02-21 11:25:06.000000000","message":"Done","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6a2264d1dce2d53082700ee153e383f5e4ca9730","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            # NOTE(TheJulia): We may want to consider moving towards using"},{"line_number":81,"context_line":"            # findfs in the future, if we\u0027re comfortable with the execution"},{"line_number":82,"context_line":"            # and interaction. There is value in either way though."},{"line_number":83,"context_line":"            # NOTE(rg): alternative: blkid -l -t UUID\u003d/PARTUUID\u003d"},{"line_number":84,"context_line":"            try:"},{"line_number":85,"context_line":"                findfs, stderr \u003d utils.execute(\u0027findfs\u0027, \u0027UUID\u003d%s\u0027 % uuid)"},{"line_number":86,"context_line":"                return findfs.strip()"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_9fcd8fb8","line":83,"updated":"2020-03-09 14:26:06.000000000","message":"awesome although I feel like there was a reason behind findfs maybe being better. I just don\u0027t remember anymore :(","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"1fb2b92756a77a7abfad5860ecb66fb073ac52e4","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            # NOTE(TheJulia): We may want to consider moving towards using"},{"line_number":81,"context_line":"            # findfs in the future, if we\u0027re comfortable with the execution"},{"line_number":82,"context_line":"            # and interaction. There is value in either way though."},{"line_number":83,"context_line":"            # NOTE(rg): alternative: blkid -l -t UUID\u003d/PARTUUID\u003d"},{"line_number":84,"context_line":"            try:"},{"line_number":85,"context_line":"                findfs, stderr \u003d utils.execute(\u0027findfs\u0027, \u0027UUID\u003d%s\u0027 % uuid)"},{"line_number":86,"context_line":"                return findfs.strip()"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_22ea44d7","line":83,"in_reply_to":"1fa4df85_9fcd8fb8","updated":"2020-03-09 15:20:53.000000000","message":"I think it was somehow related to tinyipa","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f10651dc4176e08084b2007154acf3f637904fe9","unresolved":false,"context_lines":[{"line_number":413,"context_line":"                ilib_utils.mkfs(fs\u003d\u0027vfat\u0027, path\u003dtarget_part, label\u003dfslabel)"},{"line_number":414,"context_line":"            efi_partitions.append(target_part)"},{"line_number":415,"context_line":"            # TBD: Would not hurt to destroy source efi part when defined,"},{"line_number":416,"context_line":"            # for clarity."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    elif target_boot_mode \u003d\u003d \u0027bios\u0027:"},{"line_number":419,"context_line":"        partlabel_prefix \u003d \u0027bios-boot-part-\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_a22ccbac","line":416,"updated":"2020-03-11 16:16:13.000000000","message":"Is not doing so something that could raise errors elsewhere?","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"fa166af17553fd4f9aeba6664526139bed9a1966","unresolved":false,"context_lines":[{"line_number":413,"context_line":"                ilib_utils.mkfs(fs\u003d\u0027vfat\u0027, path\u003dtarget_part, label\u003dfslabel)"},{"line_number":414,"context_line":"            efi_partitions.append(target_part)"},{"line_number":415,"context_line":"            # TBD: Would not hurt to destroy source efi part when defined,"},{"line_number":416,"context_line":"            # for clarity."},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    elif target_boot_mode \u003d\u003d \u0027bios\u0027:"},{"line_number":419,"context_line":"        partlabel_prefix \u003d \u0027bios-boot-part-\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_aad6d526","line":416,"in_reply_to":"1fa4df85_a22ccbac","updated":"2020-03-12 07:38:58.000000000","message":"Maybe ... but the fact that there are now 2 EFI partitions may also create confusion: the source one from the image is likely the one to be mounted, although it is not the one which has been used to boot the instance.","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f10651dc4176e08084b2007154acf3f637904fe9","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    \u0027sgdisk\u0027, \u0027-n\u0027, \u00270:{}:+2MiB\u0027.format(start_sector),"},{"line_number":430,"context_line":"                    \u0027-t\u0027, \u00270:ef02\u0027, \u0027-c\u0027, \u00270:{}\u0027.format(partlabel), holder)"},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"            # TBD: mbr case, should we dd the boot code from the softraid"},{"line_number":433,"context_line":"            # (446 first bytes) if we detect a bootloader with"},{"line_number":434,"context_line":"            # _is_bootloader_loaded. Not sure, as the only point to this is to"},{"line_number":435,"context_line":"            # avoid calling grub-install+mkconfig which we cannot here."},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_253f8588","line":433,"range":{"start_line":432,"start_character":0,"end_line":433,"end_character":62},"updated":"2020-03-11 16:16:13.000000000","message":"great question, most bios loaders look for a bootable partition as well, so I _suspect_ it is safe not to. I may be able to test in my home lab now that I have new disks....\n\nUpdate: Come to think of it, this won\u0027t work. Because it includes the address on the disk, as in virtual disk, where to load the data from. Since there is a structural difference, this means it will fail.","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"716c7ec8b6100621c037f5e9f27b4b0a40b8dd4c","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    \u0027sgdisk\u0027, \u0027-n\u0027, \u00270:{}:+2MiB\u0027.format(start_sector),"},{"line_number":430,"context_line":"                    \u0027-t\u0027, \u00270:ef02\u0027, \u0027-c\u0027, \u00270:{}\u0027.format(partlabel), holder)"},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"            # TBD: mbr case, should we dd the boot code from the softraid"},{"line_number":433,"context_line":"            # (446 first bytes) if we detect a bootloader with"},{"line_number":434,"context_line":"            # _is_bootloader_loaded. Not sure, as the only point to this is to"},{"line_number":435,"context_line":"            # avoid calling grub-install+mkconfig which we cannot here."},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_27abf675","line":433,"range":{"start_line":432,"start_character":0,"end_line":433,"end_character":62},"in_reply_to":"1fa4df85_0ae5a90a","updated":"2020-03-12 17:35:36.000000000","message":"++","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"fa166af17553fd4f9aeba6664526139bed9a1966","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    \u0027sgdisk\u0027, \u0027-n\u0027, \u00270:{}:+2MiB\u0027.format(start_sector),"},{"line_number":430,"context_line":"                    \u0027-t\u0027, \u00270:ef02\u0027, \u0027-c\u0027, \u00270:{}\u0027.format(partlabel), holder)"},{"line_number":431,"context_line":""},{"line_number":432,"context_line":"            # TBD: mbr case, should we dd the boot code from the softraid"},{"line_number":433,"context_line":"            # (446 first bytes) if we detect a bootloader with"},{"line_number":434,"context_line":"            # _is_bootloader_loaded. Not sure, as the only point to this is to"},{"line_number":435,"context_line":"            # avoid calling grub-install+mkconfig which we cannot here."},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_0ae5a90a","line":433,"range":{"start_line":432,"start_character":0,"end_line":433,"end_character":62},"in_reply_to":"1fa4df85_253f8588","updated":"2020-03-12 07:38:58.000000000","message":"Should the comment be updated with your thoughts, for future generations?","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f10651dc4176e08084b2007154acf3f637904fe9","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                # boot mode differs from ramdisk one)"},{"line_number":521,"context_line":"                # Probe for the correct target (depends on the arch, example"},{"line_number":522,"context_line":"                # --target\u003dx86_64-efi)"},{"line_number":523,"context_line":"                utils.execute(\u0027chroot %(path)s /bin/sh -c \u0027"},{"line_number":524,"context_line":"                              \u0027\"%(bin)s-install\"\u0027 %"},{"line_number":525,"context_line":"                              {\u0027path\u0027: path, \u0027bin\u0027: binary_name},"},{"line_number":526,"context_line":"                              shell\u003dTrue,"},{"line_number":527,"context_line":"                              env_variables\u003d{"},{"line_number":528,"context_line":"                                  \u0027PATH\u0027: path_variable"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_c58c7181","line":525,"range":{"start_line":523,"start_character":0,"end_line":525,"end_character":65},"updated":"2020-03-11 16:16:13.000000000","message":"so it occurs to me, and we will likely want to fix this soonish, is that this means an unsighed bootloader gets put in place. it may be best to re-use some of the code iury put in place to search for the efi binary and update the efi loader if the contents are found.","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"fa166af17553fd4f9aeba6664526139bed9a1966","unresolved":false,"context_lines":[{"line_number":520,"context_line":"                # boot mode differs from ramdisk one)"},{"line_number":521,"context_line":"                # Probe for the correct target (depends on the arch, example"},{"line_number":522,"context_line":"                # --target\u003dx86_64-efi)"},{"line_number":523,"context_line":"                utils.execute(\u0027chroot %(path)s /bin/sh -c \u0027"},{"line_number":524,"context_line":"                              \u0027\"%(bin)s-install\"\u0027 %"},{"line_number":525,"context_line":"                              {\u0027path\u0027: path, \u0027bin\u0027: binary_name},"},{"line_number":526,"context_line":"                              shell\u003dTrue,"},{"line_number":527,"context_line":"                              env_variables\u003d{"},{"line_number":528,"context_line":"                                  \u0027PATH\u0027: path_variable"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_8abaf9de","line":525,"range":{"start_line":523,"start_character":0,"end_line":525,"end_character":65},"in_reply_to":"1fa4df85_c58c7181","updated":"2020-03-12 07:38:58.000000000","message":"The refactor list gets longer and longer :)","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f10651dc4176e08084b2007154acf3f637904fe9","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            for grub_disk in disks:"},{"line_number":564,"context_line":"                LOG.debug(\"Installing GRUB2 on disk %s\", grub_disk)"},{"line_number":565,"context_line":"                utils.execute("},{"line_number":566,"context_line":"                    \u0027chroot %(path)s /bin/sh -c \"%(bin)s-install %(dev)s\"\u0027 %"},{"line_number":567,"context_line":"                    {"},{"line_number":568,"context_line":"                        \u0027path\u0027: path,"},{"line_number":569,"context_line":"                        \u0027bin\u0027: binary_name,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_65e7bd48","line":566,"updated":"2020-03-11 16:16:13.000000000","message":"ditto","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":15519,"name":"Iury Gregory Melo Ferreira","display_name":"Iury Gregory","email":"iurygregory@gmail.com","username":"iurygregory"},"change_message_id":"193d7334f8a95a2224d15cf6dbea7399e94a21ce","unresolved":false,"context_lines":[{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # In case we can\u0027t use efibootmgr for uefi we will continue using grub2"},{"line_number":695,"context_line":"        LOG.debug(\u0027Using grub2-install to set up boot files\u0027)"},{"line_number":696,"context_line":"        _install_grub2(device,"},{"line_number":697,"context_line":"                       root_uuid\u003droot_uuid,"},{"line_number":698,"context_line":"                       efi_system_part_uuid\u003defi_system_part_uuid,"},{"line_number":699,"context_line":"                       prep_boot_part_uuid\u003dprep_boot_part_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_fe7ecead","line":696,"updated":"2020-03-12 10:02:07.000000000","message":"I\u0027m in the middle of a puzzle here...\nHow we detect that Software Raid will be used?\nIf it\u0027s uefi +software raid we things may just work till _manage_uefi and we won\u0027t call install_grub2","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"7b3602f6a69a9a891c663e00b0b7dabbdb15971f","unresolved":false,"context_lines":[{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # In case we can\u0027t use efibootmgr for uefi we will continue using grub2"},{"line_number":695,"context_line":"        LOG.debug(\u0027Using grub2-install to set up boot files\u0027)"},{"line_number":696,"context_line":"        _install_grub2(device,"},{"line_number":697,"context_line":"                       root_uuid\u003droot_uuid,"},{"line_number":698,"context_line":"                       efi_system_part_uuid\u003defi_system_part_uuid,"},{"line_number":699,"context_line":"                       prep_boot_part_uuid\u003dprep_boot_part_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_54cb4371","line":696,"in_reply_to":"1fa4df85_41ce2784","updated":"2020-03-12 11:18:38.000000000","message":"Another option is to add \"and not hardware.is_md_device(device)\" to the if in line 681 and to move to _install_grub2.","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"ed3ab4eebc23c20745b7aadcd35d72996e438e70","unresolved":false,"context_lines":[{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # In case we can\u0027t use efibootmgr for uefi we will continue using grub2"},{"line_number":695,"context_line":"        LOG.debug(\u0027Using grub2-install to set up boot files\u0027)"},{"line_number":696,"context_line":"        _install_grub2(device,"},{"line_number":697,"context_line":"                       root_uuid\u003droot_uuid,"},{"line_number":698,"context_line":"                       efi_system_part_uuid\u003defi_system_part_uuid,"},{"line_number":699,"context_line":"                       prep_boot_part_uuid\u003dprep_boot_part_uuid,"}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_41ce2784","line":696,"in_reply_to":"1fa4df85_fe7ecead","updated":"2020-03-12 10:37:47.000000000","message":"Yes, I think you are right: this special UEFI handling preempts the bootloader installation needed for software RAID.\n\nWe need to either limit when this shortcut is taken or add sth which enforces calling _grub2_install.","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"ea10729d98a8f035c48038bdf40c71a0bfb85f38","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                shutil.rmtree(local_path)"},{"line_number":331,"context_line":""},{"line_number":332,"context_line":""},{"line_number":333,"context_line":"# TODO(rg): handle PreP boot parts relocation as well"},{"line_number":334,"context_line":"def _prepare_boot_partitions_for_softraid(device, holders, efi_part,"},{"line_number":335,"context_line":"                                          target_boot_mode):"},{"line_number":336,"context_line":"    \"\"\"Prepare boot partitions when relevant."}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_1d41af0c","line":333,"updated":"2020-03-23 20:05:57.000000000","message":"Luckily, I don\u0027t expect that to be too much of an issue.","commit_id":"e60ac1fed7fec40f4500ef3c6574f473b2ca0d74"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            # device and partition for bootloader contents."},{"line_number":179,"context_line":"            if \u0027boot\u0027 in partition[6]:"},{"line_number":180,"context_line":"                if (_has_boot_sector(dev)"},{"line_number":181,"context_line":"                        or _has_boot_sector(partition[0])):"},{"line_number":182,"context_line":"                    return True"},{"line_number":183,"context_line":"        except IndexError:"},{"line_number":184,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_c507ae17","line":181,"updated":"2020-04-02 08:20:09.000000000","message":"nit: unrelated?","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":178,"context_line":"            # device and partition for bootloader contents."},{"line_number":179,"context_line":"            if \u0027boot\u0027 in partition[6]:"},{"line_number":180,"context_line":"                if (_has_boot_sector(dev)"},{"line_number":181,"context_line":"                        or _has_boot_sector(partition[0])):"},{"line_number":182,"context_line":"                    return True"},{"line_number":183,"context_line":"        except IndexError:"},{"line_number":184,"context_line":"            continue"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_7f8f4b29","line":181,"in_reply_to":"df33271e_c507ae17","updated":"2020-04-02 16:04:33.000000000","message":"You mean an accidental introduction of white spaces?\nProbably ... removed.","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":477,"context_line":"            holders \u003d hardware.get_holder_disks(device)"},{"line_number":478,"context_line":"            efi_partitions \u003d _prepare_boot_partitions_for_softraid("},{"line_number":479,"context_line":"                device, holders, efi_part, target_boot_mode"},{"line_number":480,"context_line":"            )"},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"        if efi_partitions:"},{"line_number":483,"context_line":"            efi_partition_mount_point \u003d os.path.join(path, \"boot/efi\")"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_c5204e9e","line":480,"updated":"2020-04-02 08:20:09.000000000","message":"To recap our IRC discussions: this should be moved out of install_grub2 since it\u0027s not strictly speaking a part of it. Can be done in a follow-up.","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        iscsi.clean_up(device)"},{"line_number":683,"context_line":"        boot \u003d hardware.dispatch_to_managers(\u0027get_boot_info\u0027)"},{"line_number":684,"context_line":"        if (boot.current_boot_mode \u003d\u003d \u0027uefi\u0027 and"},{"line_number":685,"context_line":"            not hardware.is_md_device(device)):"},{"line_number":686,"context_line":"            has_efibootmgr \u003d True"},{"line_number":687,"context_line":"            try:"},{"line_number":688,"context_line":"                utils.execute(\u0027efibootmgr\u0027, \u0027--version\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_854f6669","line":685,"updated":"2020-04-02 08:20:09.000000000","message":"This will fail the new pep8 check\n\nEventually, we should move the partition relocation code before this block and keep using efibootmgr.","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        iscsi.clean_up(device)"},{"line_number":683,"context_line":"        boot \u003d hardware.dispatch_to_managers(\u0027get_boot_info\u0027)"},{"line_number":684,"context_line":"        if (boot.current_boot_mode \u003d\u003d \u0027uefi\u0027 and"},{"line_number":685,"context_line":"            not hardware.is_md_device(device)):"},{"line_number":686,"context_line":"            has_efibootmgr \u003d True"},{"line_number":687,"context_line":"            try:"},{"line_number":688,"context_line":"                utils.execute(\u0027efibootmgr\u0027, \u0027--version\u0027)"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_1f8b9fc2","line":685,"in_reply_to":"df33271e_854f6669","updated":"2020-04-02 16:04:33.000000000","message":"fixed pep8","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":360,"context_line":"    :param device: the softraid device path"},{"line_number":361,"context_line":"    :param holders: the softraid drive members"},{"line_number":362,"context_line":"    :param efi_part: when relevant the efi partition coming from the image"},{"line_number":363,"context_line":"    deployed on softraid device, can be/is often None"},{"line_number":364,"context_line":"    :param target_boot_mode: target boot mode can be bios/uefi/None"},{"line_number":365,"context_line":"    or anything else for unspecified"},{"line_number":366,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_c612cfb4","line":363,"updated":"2020-04-06 08:50:22.000000000","message":"nit: missing indentation","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":365,"context_line":"    or anything else for unspecified"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    :returns: the efi partition paths on softraid disk holders when target"},{"line_number":368,"context_line":"    boot mode is uefi, empty list otherwise."},{"line_number":369,"context_line":"    \"\"\""},{"line_number":370,"context_line":"    efi_partitions \u003d []"},{"line_number":371,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_a617cba3","line":368,"updated":"2020-04-06 08:50:22.000000000","message":"ditto","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":371,"context_line":""},{"line_number":372,"context_line":"    # Actually any fat partition could be a candidate. Let\u0027s assume the"},{"line_number":373,"context_line":"    # partition also has the esp flag"},{"line_number":374,"context_line":"    if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":375,"context_line":"        if not efi_part:"},{"line_number":376,"context_line":""},{"line_number":377,"context_line":"            LOG.debug(\"No explicit EFI partition provided. Scanning for any \""}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_060dd78f","line":374,"updated":"2020-04-06 08:50:22.000000000","message":"nit: refactor each boot mode handling into its own function for readability\n\nand maybe move to some new module to stop growing this file?","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":386,"context_line":"            efi_part \u003d utils.get_efi_part_on_device(device)"},{"line_number":387,"context_line":"            if efi_part:"},{"line_number":388,"context_line":"                efi_part \u003d \u0027{}p{}\u0027.format(device, efi_part)"},{"line_number":389,"context_line":""},{"line_number":390,"context_line":"        # We know that we kept this space when configuring raid,see"},{"line_number":391,"context_line":"        # hardware.GenericHardwareManager.create_configuration."},{"line_number":392,"context_line":"        # We could also directly get the EFI partition size."}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_e611d3ae","line":389,"updated":"2020-04-06 08:50:22.000000000","message":"nit: LOG.info with a summary of what we\u0027re about to do","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":414,"context_line":""},{"line_number":415,"context_line":"            target_part \u003d target_part.splitlines()[-1].split(\u0027:\u0027, 1)[0]"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"            LOG.debug(\"Efi partition %s created on disk holder %s\","},{"line_number":418,"context_line":"                      target_part, holder)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"            if efi_part:"}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_4626bf18","line":417,"updated":"2020-04-06 08:50:22.000000000","message":"nit: EFI","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":418,"context_line":"                      target_part, holder)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"            if efi_part:"},{"line_number":421,"context_line":"                LOG.debug(\"Relocating efi %s to holder part %s\", efi_part,"},{"line_number":422,"context_line":"                          target_part)"},{"line_number":423,"context_line":"                # Blockdev copy"},{"line_number":424,"context_line":"                utils.execute(\"cp\", efi_part, target_part)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_2623bb07","line":421,"updated":"2020-04-06 08:50:22.000000000","message":"ditto","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":711,"context_line":"        iscsi.clean_up(device)"},{"line_number":712,"context_line":"        boot \u003d hardware.dispatch_to_managers(\u0027get_boot_info\u0027)"},{"line_number":713,"context_line":"        if (boot.current_boot_mode \u003d\u003d \u0027uefi\u0027"},{"line_number":714,"context_line":"                and not hardware.is_md_device(device)):"},{"line_number":715,"context_line":"            has_efibootmgr \u003d True"},{"line_number":716,"context_line":"            try:"},{"line_number":717,"context_line":"                utils.execute(\u0027efibootmgr\u0027, \u0027--version\u0027)"}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_8620c7f9","line":714,"updated":"2020-04-06 08:50:22.000000000","message":"let\u0027s leave a FIXME to lift this limitation (or just fix it right away)","commit_id":"9343348106b46377df8327dbb8f914266b150979"}],"ironic_python_agent/hardware.py":[{"author":{"_account_id":12898,"name":"Tony Breeds","email":"tony@bakeyournoodle.com","username":"tonyb"},"change_message_id":"8a218e0125ec80663d8bc2fe294f3ffce523e715","unresolved":false,"context_lines":[{"line_number":1580,"context_line":"                    # This should avoid grub errors saying that it cannot"},{"line_number":1581,"context_line":"                    # install boot stage 1.5/2 (since the mbr gap does not"},{"line_number":1582,"context_line":"                    # exist on disk holders with gpt tables)"},{"line_number":1583,"context_line":"                    raid_start \u003d \u00273MiB\u0027"},{"line_number":1584,"context_line":"                else:"},{"line_number":1585,"context_line":"                    # sgdisk works fine for display data on mbr tables too"},{"line_number":1586,"context_line":"                    out, _u \u003d utils.execute(\u0027sgdisk\u0027, \u0027-F\u0027, block_device.name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_6744781c","line":1583,"updated":"2020-03-26 02:07:52.000000000","message":"ppc prepboot partitions should be 8MiB.  I don\u0027t honestly know if this is a defined standard or just common best practice","commit_id":"e60ac1fed7fec40f4500ef3c6574f473b2ca0d74"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"32625aa651565d45c1c740dd729c0736c2ed31c7","unresolved":false,"context_lines":[{"line_number":1580,"context_line":"                    # This should avoid grub errors saying that it cannot"},{"line_number":1581,"context_line":"                    # install boot stage 1.5/2 (since the mbr gap does not"},{"line_number":1582,"context_line":"                    # exist on disk holders with gpt tables)"},{"line_number":1583,"context_line":"                    raid_start \u003d \u00273MiB\u0027"},{"line_number":1584,"context_line":"                else:"},{"line_number":1585,"context_line":"                    # sgdisk works fine for display data on mbr tables too"},{"line_number":1586,"context_line":"                    out, _u \u003d utils.execute(\u0027sgdisk\u0027, \u0027-F\u0027, block_device.name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_d15eb474","line":1583,"in_reply_to":"df33271e_6744781c","updated":"2020-03-29 01:29:09.000000000","message":"i do seem to remember mjturek or one of the power folks talking about this once before. I suspect it is standard for power hardware.","commit_id":"e60ac1fed7fec40f4500ef3c6574f473b2ca0d74"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"b6b69f89f1eb2c94579d3eacad79a9004130a623","unresolved":false,"context_lines":[{"line_number":1580,"context_line":"                    # This should avoid grub errors saying that it cannot"},{"line_number":1581,"context_line":"                    # install boot stage 1.5/2 (since the mbr gap does not"},{"line_number":1582,"context_line":"                    # exist on disk holders with gpt tables)"},{"line_number":1583,"context_line":"                    raid_start \u003d \u00273MiB\u0027"},{"line_number":1584,"context_line":"                else:"},{"line_number":1585,"context_line":"                    # sgdisk works fine for display data on mbr tables too"},{"line_number":1586,"context_line":"                    out, _u \u003d utils.execute(\u0027sgdisk\u0027, \u0027-F\u0027, block_device.name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"df33271e_714d28c3","line":1583,"in_reply_to":"df33271e_d15eb474","updated":"2020-03-30 13:49:54.000000000","message":"I guess this is just","commit_id":"e60ac1fed7fec40f4500ef3c6574f473b2ca0d74"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":1586,"context_line":"                    out, _u \u003d utils.execute(\u0027sgdisk\u0027, \u0027-F\u0027, block_device.name)"},{"line_number":1587,"context_line":"                    raid_start \u003d \"{}s\".format(out.splitlines()[-1])"},{"line_number":1588,"context_line":""},{"line_number":1589,"context_line":"            parted_start_dict[block_device.name] \u003d raid_start"},{"line_number":1590,"context_line":""},{"line_number":1591,"context_line":"        LOG.debug(\"First available sectors per devices %s\", parted_start_dict)"},{"line_number":1592,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_255dba14","line":1589,"updated":"2020-04-02 08:20:09.000000000","message":"This needs an update after rebasing (block_device is a string now, so s/.name//)","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":1586,"context_line":"                    out, _u \u003d utils.execute(\u0027sgdisk\u0027, \u0027-F\u0027, block_device.name)"},{"line_number":1587,"context_line":"                    raid_start \u003d \"{}s\".format(out.splitlines()[-1])"},{"line_number":1588,"context_line":""},{"line_number":1589,"context_line":"            parted_start_dict[block_device.name] \u003d raid_start"},{"line_number":1590,"context_line":""},{"line_number":1591,"context_line":"        LOG.debug(\"First available sectors per devices %s\", parted_start_dict)"},{"line_number":1592,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_1f79dfc6","line":1589,"in_reply_to":"df33271e_255dba14","updated":"2020-04-02 16:04:33.000000000","message":"done, there are several places where this needed to be changed ... and the loop variable name had changed as well","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":15064,"name":"raphael.glon","email":"raphael.glon@corp.ovh.com","username":"raphael"},"change_message_id":"2bb458073294c8f8c4dee142e36bc69f5b388fcd","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                raid_start \u003d \u0027129MiB\u0027"},{"line_number":1583,"context_line":"            else:"},{"line_number":1584,"context_line":"                if partition_table_type \u003d\u003d \u0027gpt\u0027:"},{"line_number":1585,"context_line":"                    # Leave 8MiB - start_sector s (approx 2MiB)"},{"line_number":1586,"context_line":"                    # for the bios boot partition or the ppc prepboot part"},{"line_number":1587,"context_line":"                    # This should avoid grub errors saying that it cannot"},{"line_number":1588,"context_line":"                    # install boot stage 1.5/2 (since the mbr gap does not"}],"source_content_type":"text/x-python","patch_set":10,"id":"df33271e_e740eda7","line":1585,"updated":"2020-04-02 15:52:00.000000000","message":"8MiB - start_sector is usually 7MiB not 2MiB (probably different for 4k drives)","commit_id":"821f4dd22872e57650d53c561810ea57295ade38"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":1582,"context_line":"                raid_start \u003d \u0027129MiB\u0027"},{"line_number":1583,"context_line":"            else:"},{"line_number":1584,"context_line":"                if partition_table_type \u003d\u003d \u0027gpt\u0027:"},{"line_number":1585,"context_line":"                    # Leave 8MiB - start_sector s (approx 2MiB)"},{"line_number":1586,"context_line":"                    # for the bios boot partition or the ppc prepboot part"},{"line_number":1587,"context_line":"                    # This should avoid grub errors saying that it cannot"},{"line_number":1588,"context_line":"                    # install boot stage 1.5/2 (since the mbr gap does not"}],"source_content_type":"text/x-python","patch_set":10,"id":"df33271e_62896b73","line":1585,"in_reply_to":"df33271e_e740eda7","updated":"2020-04-02 16:04:33.000000000","message":"Done","commit_id":"821f4dd22872e57650d53c561810ea57295ade38"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":1573,"context_line":"            # correctly according to what they intend to do (eg not set MAX if"},{"line_number":1574,"context_line":"            # they know they will need some space for bios boot or efi parts."},{"line_number":1575,"context_line":"            # (Best option imo, if we accept that the target volume granularity"},{"line_number":1576,"context_line":"            # is GiB, so you lose up to 1GiB just for a bios boot partition...)"},{"line_number":1577,"context_line":"            if target_boot_mode \u003d\u003d \u0027uefi\u0027:"},{"line_number":1578,"context_line":"                # Leave 129MiB - start_sector s for the esp (approx 128MiB)"},{"line_number":1579,"context_line":"                # NOTE: any image efi partition is expected to be less"}],"source_content_type":"text/x-python","patch_set":11,"id":"df33271e_263a9b33","line":1576,"updated":"2020-04-06 08:50:22.000000000","message":"++ (and let\u0027s document it)","commit_id":"9343348106b46377df8327dbb8f914266b150979"}],"ironic_python_agent/utils.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":502,"context_line":"    \"\"\""},{"line_number":503,"context_line":""},{"line_number":504,"context_line":"    capabilities \u003d root.get(\u0027capabilities\u0027, {})"},{"line_number":505,"context_line":"    if isinstance(capabilities, six.string_types):"},{"line_number":506,"context_line":"        try:"},{"line_number":507,"context_line":"            capabilities \u003d jsonutils.loads(capabilities)"},{"line_number":508,"context_line":"        except (ValueError, TypeError):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_b57463ce","line":505,"updated":"2020-01-23 10:02:14.000000000","message":"I think we no longer depend on six here..","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":518,"context_line":"def _is_secure_boot(instance_info_caps, node_caps):"},{"line_number":519,"context_line":"    \"\"\"Extract node secure boot property\"\"\""},{"line_number":520,"context_line":"    return \u0027true\u0027 \u003d\u003d str(instance_info_caps.get("},{"line_number":521,"context_line":"        \u0027secure_boot\u0027, node_caps.get(\u0027secure_boot\u0027, \u0027false\u0027))).lower()"},{"line_number":522,"context_line":""},{"line_number":523,"context_line":""},{"line_number":524,"context_line":"# TODO(rg): This method should be mutualized with the one found in"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_55472f7b","line":521,"updated":"2020-01-23 10:02:14.000000000","message":"nit: better use functions from oslo_utils.strutils (bool_from_string)","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":527,"context_line":"# 1. node is a dict, not an ironic.objects.node"},{"line_number":528,"context_line":"# 2. implicit bios boot mode when using trusted boot capability is removed:"},{"line_number":529,"context_line":"# there is no reason why trusted_boot should imply bios boot mode."},{"line_number":530,"context_line":"def get_node_boot_mode(node):"},{"line_number":531,"context_line":"    \"\"\"Returns the node boot mode."},{"line_number":532,"context_line":""},{"line_number":533,"context_line":"    It returns \u0027uefi\u0027 if \u0027secure_boot\u0027 is set to \u0027true\u0027 in"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_754cab9c","line":530,"updated":"2020-01-23 10:02:14.000000000","message":"Can we actually pass this information from ironic? I\u0027m afraid of this logic diverging from what ironic expects..","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6a2264d1dce2d53082700ee153e383f5e4ca9730","unresolved":false,"context_lines":[{"line_number":456,"context_line":"    return (m.group(1) or m.group(2))"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"# See ironic.drivers.utils.get_node_capability"},{"line_number":460,"context_line":"def _parse_capabilities_str(cap_str):"},{"line_number":461,"context_line":"    \"\"\"Extract capabilities from string."},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    :param cap_str: string meant to meet key1:value1,key2:value2 format"},{"line_number":464,"context_line":"    :return: a dictionnary"},{"line_number":465,"context_line":"    \"\"\""},{"line_number":466,"context_line":"    LOG.debug(\"Parsing capability string %s\", cap_str)"},{"line_number":467,"context_line":"    capabilities \u003d {}"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"    for node_capability in cap_str.split(\u0027,\u0027):"},{"line_number":470,"context_line":"        parts \u003d node_capability.split(\u0027:\u0027)"},{"line_number":471,"context_line":"        if len(parts) \u003d\u003d 2 and parts[0] and parts[1]:"},{"line_number":472,"context_line":"            capabilities[parts[0]] \u003d parts[1]"},{"line_number":473,"context_line":"        else:"},{"line_number":474,"context_line":"            LOG.warning(\"Ignoring malformed capability \u0027%s\u0027. \""},{"line_number":475,"context_line":"                        \"Format should be \u0027key:val\u0027.\", node_capability)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    LOG.debug(\"Parsed capabilities %s\", capabilities)"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"    return capabilities"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":483,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":484,"context_line":"# node.instance_info.capabilities differently"},{"line_number":485,"context_line":"def parse_capabilities(root):"},{"line_number":486,"context_line":"    \"\"\"Extract capabilities from provided root dictionnary-behaving object."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"},{"line_number":489,"context_line":"    a key1:value1,key2:value2 formatted string."},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    :param root: Anything behaving like a dict and containing capabilities"},{"line_number":492,"context_line":"                 formatted as expected. Can be node.get(\u0027properties\u0027, {}),"},{"line_number":493,"context_line":"                 node.get(\u0027instance_info\u0027, {})."},{"line_number":494,"context_line":"    :returns: A dictionary with the capabilities if found and well formatted,"},{"line_number":495,"context_line":"              otherwise an empty dictionary."},{"line_number":496,"context_line":"    \"\"\""},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    capabilities \u003d root.get(\u0027capabilities\u0027, {})"},{"line_number":499,"context_line":"    if isinstance(capabilities, six.string_types):"},{"line_number":500,"context_line":"        try:"},{"line_number":501,"context_line":"            capabilities \u003d jsonutils.loads(capabilities)"},{"line_number":502,"context_line":"        except (ValueError, TypeError):"},{"line_number":503,"context_line":"            capabilities \u003d _parse_capabilities_str(capabilities)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    if not isinstance(capabilities, dict):"},{"line_number":506,"context_line":"        LOG.warning(\"Invalid capabilities %s\", capabilities)"},{"line_number":507,"context_line":"        return {}"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"    return capabilities"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"def _is_secure_boot(instance_info_caps, node_caps):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_ff5283dd","line":509,"range":{"start_line":459,"start_character":0,"end_line":509,"end_character":23},"updated":"2020-03-09 14:26:06.000000000","message":"This is feeling like we should be adding these to ironic-lib. TBH.","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"cf87bc9fc8b755dda0c5ba49967ea345ea0bb8b8","unresolved":false,"context_lines":[{"line_number":456,"context_line":"    return (m.group(1) or m.group(2))"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"# See ironic.drivers.utils.get_node_capability"},{"line_number":460,"context_line":"def _parse_capabilities_str(cap_str):"},{"line_number":461,"context_line":"    \"\"\"Extract capabilities from string."},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    :param cap_str: string meant to meet key1:value1,key2:value2 format"},{"line_number":464,"context_line":"    :return: a dictionnary"},{"line_number":465,"context_line":"    \"\"\""},{"line_number":466,"context_line":"    LOG.debug(\"Parsing capability string %s\", cap_str)"},{"line_number":467,"context_line":"    capabilities \u003d {}"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"    for node_capability in cap_str.split(\u0027,\u0027):"},{"line_number":470,"context_line":"        parts \u003d node_capability.split(\u0027:\u0027)"},{"line_number":471,"context_line":"        if len(parts) \u003d\u003d 2 and parts[0] and parts[1]:"},{"line_number":472,"context_line":"            capabilities[parts[0]] \u003d parts[1]"},{"line_number":473,"context_line":"        else:"},{"line_number":474,"context_line":"            LOG.warning(\"Ignoring malformed capability \u0027%s\u0027. \""},{"line_number":475,"context_line":"                        \"Format should be \u0027key:val\u0027.\", node_capability)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    LOG.debug(\"Parsed capabilities %s\", capabilities)"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"    return capabilities"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":483,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":484,"context_line":"# node.instance_info.capabilities differently"},{"line_number":485,"context_line":"def parse_capabilities(root):"},{"line_number":486,"context_line":"    \"\"\"Extract capabilities from provided root dictionnary-behaving object."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"},{"line_number":489,"context_line":"    a key1:value1,key2:value2 formatted string."},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    :param root: Anything behaving like a dict and containing capabilities"},{"line_number":492,"context_line":"                 formatted as expected. Can be node.get(\u0027properties\u0027, {}),"},{"line_number":493,"context_line":"                 node.get(\u0027instance_info\u0027, {})."},{"line_number":494,"context_line":"    :returns: A dictionary with the capabilities if found and well formatted,"},{"line_number":495,"context_line":"              otherwise an empty dictionary."},{"line_number":496,"context_line":"    \"\"\""},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    capabilities \u003d root.get(\u0027capabilities\u0027, {})"},{"line_number":499,"context_line":"    if isinstance(capabilities, six.string_types):"},{"line_number":500,"context_line":"        try:"},{"line_number":501,"context_line":"            capabilities \u003d jsonutils.loads(capabilities)"},{"line_number":502,"context_line":"        except (ValueError, TypeError):"},{"line_number":503,"context_line":"            capabilities \u003d _parse_capabilities_str(capabilities)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    if not isinstance(capabilities, dict):"},{"line_number":506,"context_line":"        LOG.warning(\"Invalid capabilities %s\", capabilities)"},{"line_number":507,"context_line":"        return {}"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"    return capabilities"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"def _is_secure_boot(instance_info_caps, node_caps):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_a5b39ee8","line":509,"range":{"start_line":459,"start_character":0,"end_line":509,"end_character":23},"in_reply_to":"1fa4df85_62e4bc0d","updated":"2020-03-09 16:40:27.000000000","message":"This is (part of) the required cleanup I mentioned at the mid-cycle.\n\nFor now, I focused on getting the functionality right and especially tested. But we should definitely take a step back and look at the RAID and UEFI changes which went in this cycle, as some of them were disconnected and the code reflects this.\n\nUnless you have strong objections, though, I\u0027d suggest to get these changes in and do the refactor after (yeah, I know what you think ;-). I\u0027m somewhat worried that if we reshuffled things too much now, it will a little bit tight to retest everything thoroughly.","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"1fb2b92756a77a7abfad5860ecb66fb073ac52e4","unresolved":false,"context_lines":[{"line_number":456,"context_line":"    return (m.group(1) or m.group(2))"},{"line_number":457,"context_line":""},{"line_number":458,"context_line":""},{"line_number":459,"context_line":"# See ironic.drivers.utils.get_node_capability"},{"line_number":460,"context_line":"def _parse_capabilities_str(cap_str):"},{"line_number":461,"context_line":"    \"\"\"Extract capabilities from string."},{"line_number":462,"context_line":""},{"line_number":463,"context_line":"    :param cap_str: string meant to meet key1:value1,key2:value2 format"},{"line_number":464,"context_line":"    :return: a dictionnary"},{"line_number":465,"context_line":"    \"\"\""},{"line_number":466,"context_line":"    LOG.debug(\"Parsing capability string %s\", cap_str)"},{"line_number":467,"context_line":"    capabilities \u003d {}"},{"line_number":468,"context_line":""},{"line_number":469,"context_line":"    for node_capability in cap_str.split(\u0027,\u0027):"},{"line_number":470,"context_line":"        parts \u003d node_capability.split(\u0027:\u0027)"},{"line_number":471,"context_line":"        if len(parts) \u003d\u003d 2 and parts[0] and parts[1]:"},{"line_number":472,"context_line":"            capabilities[parts[0]] \u003d parts[1]"},{"line_number":473,"context_line":"        else:"},{"line_number":474,"context_line":"            LOG.warning(\"Ignoring malformed capability \u0027%s\u0027. \""},{"line_number":475,"context_line":"                        \"Format should be \u0027key:val\u0027.\", node_capability)"},{"line_number":476,"context_line":""},{"line_number":477,"context_line":"    LOG.debug(\"Parsed capabilities %s\", capabilities)"},{"line_number":478,"context_line":""},{"line_number":479,"context_line":"    return capabilities"},{"line_number":480,"context_line":""},{"line_number":481,"context_line":""},{"line_number":482,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":483,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":484,"context_line":"# node.instance_info.capabilities differently"},{"line_number":485,"context_line":"def parse_capabilities(root):"},{"line_number":486,"context_line":"    \"\"\"Extract capabilities from provided root dictionnary-behaving object."},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"},{"line_number":489,"context_line":"    a key1:value1,key2:value2 formatted string."},{"line_number":490,"context_line":""},{"line_number":491,"context_line":"    :param root: Anything behaving like a dict and containing capabilities"},{"line_number":492,"context_line":"                 formatted as expected. Can be node.get(\u0027properties\u0027, {}),"},{"line_number":493,"context_line":"                 node.get(\u0027instance_info\u0027, {})."},{"line_number":494,"context_line":"    :returns: A dictionary with the capabilities if found and well formatted,"},{"line_number":495,"context_line":"              otherwise an empty dictionary."},{"line_number":496,"context_line":"    \"\"\""},{"line_number":497,"context_line":""},{"line_number":498,"context_line":"    capabilities \u003d root.get(\u0027capabilities\u0027, {})"},{"line_number":499,"context_line":"    if isinstance(capabilities, six.string_types):"},{"line_number":500,"context_line":"        try:"},{"line_number":501,"context_line":"            capabilities \u003d jsonutils.loads(capabilities)"},{"line_number":502,"context_line":"        except (ValueError, TypeError):"},{"line_number":503,"context_line":"            capabilities \u003d _parse_capabilities_str(capabilities)"},{"line_number":504,"context_line":""},{"line_number":505,"context_line":"    if not isinstance(capabilities, dict):"},{"line_number":506,"context_line":"        LOG.warning(\"Invalid capabilities %s\", capabilities)"},{"line_number":507,"context_line":"        return {}"},{"line_number":508,"context_line":""},{"line_number":509,"context_line":"    return capabilities"},{"line_number":510,"context_line":""},{"line_number":511,"context_line":""},{"line_number":512,"context_line":"def _is_secure_boot(instance_info_caps, node_caps):"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_62e4bc0d","line":509,"range":{"start_line":459,"start_character":0,"end_line":509,"end_character":23},"in_reply_to":"1fa4df85_ff5283dd","updated":"2020-03-09 15:20:53.000000000","message":"We absolutely should, this code exists in too many places","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6a2264d1dce2d53082700ee153e383f5e4ca9730","unresolved":false,"context_lines":[{"line_number":516,"context_line":""},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"# TODO(rg): This method should be mutualized with the one found in"},{"line_number":519,"context_line":"# ironic.drivers.modules.boot_mode_utils."},{"line_number":520,"context_line":"# The only difference here:"},{"line_number":521,"context_line":"# 1. node is a dict, not an ironic.objects.node"},{"line_number":522,"context_line":"# 2. implicit bios boot mode when using trusted boot capability is removed:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_bf072bca","line":519,"updated":"2020-03-09 14:26:06.000000000","message":"++ I feel like we should try and move some of this stuff into ironic_lib. No objection for it merging now though and then getting ripped out and replaced with ironic-lib items next cycle.","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6a2264d1dce2d53082700ee153e383f5e4ca9730","unresolved":false,"context_lines":[{"line_number":521,"context_line":"# 1. node is a dict, not an ironic.objects.node"},{"line_number":522,"context_line":"# 2. implicit bios boot mode when using trusted boot capability is removed:"},{"line_number":523,"context_line":"# there is no reason why trusted_boot should imply bios boot mode."},{"line_number":524,"context_line":"def get_node_boot_mode(node):"},{"line_number":525,"context_line":"    \"\"\"Returns the node boot mode."},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"    It returns \u0027uefi\u0027 if \u0027secure_boot\u0027 is set to \u0027true\u0027 in"}],"source_content_type":"text/x-python","patch_set":5,"id":"1fa4df85_3ffb3bc1","line":524,"updated":"2020-03-09 14:26:06.000000000","message":"The only thing we\u0027ll want to do when we move these is provide mappings to the other method in case anyone leverages these.","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":15519,"name":"Iury Gregory Melo Ferreira","display_name":"Iury Gregory","email":"iurygregory@gmail.com","username":"iurygregory"},"change_message_id":"15c98b9b8a42fb775831fb9c6d6765108b41d8f6","unresolved":false,"context_lines":[{"line_number":31,"context_line":"from oslo_serialization import base64"},{"line_number":32,"context_line":"from oslo_serialization import jsonutils"},{"line_number":33,"context_line":"from oslo_utils import units"},{"line_number":34,"context_line":"import six"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"from ironic_python_agent import errors"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"1fa4df85_4a82c102","line":34,"range":{"start_line":34,"start_character":0,"end_line":34,"end_character":10},"updated":"2020-03-12 07:55:12.000000000","message":"What?!","commit_id":"f576e1d3c4a94c8e376cfe4cfc6c8057a58063bc"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":483,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":484,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":485,"context_line":"# node.instance_info.capabilities differently"},{"line_number":486,"context_line":"def parse_capabilities(root):"},{"line_number":487,"context_line":"    \"\"\"Extract capabilities from provided root dictionary-behaving object."},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_e5abd2d2","line":486,"updated":"2020-04-02 08:20:09.000000000","message":"TODO: move this to ironic_lib (cannot be done in Ussuri)","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"04b90ce0007aab17c602910d64b19d59af1e23c7","unresolved":false,"context_lines":[{"line_number":483,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":484,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":485,"context_line":"# node.instance_info.capabilities differently"},{"line_number":486,"context_line":"def parse_capabilities(root):"},{"line_number":487,"context_line":"    \"\"\"Extract capabilities from provided root dictionary-behaving object."},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_7d9d8eba","line":486,"in_reply_to":"df33271e_da078517","updated":"2020-04-02 16:37:37.000000000","message":"In a later change because the final release of ironic-lib for Ussuri has already been done.","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":483,"context_line":"# See ironic.common.utils.parse_instance_info_capabilities. Same except that"},{"line_number":484,"context_line":"# we do not handle node.properties.capabilities and"},{"line_number":485,"context_line":"# node.instance_info.capabilities differently"},{"line_number":486,"context_line":"def parse_capabilities(root):"},{"line_number":487,"context_line":"    \"\"\"Extract capabilities from provided root dictionary-behaving object."},{"line_number":488,"context_line":""},{"line_number":489,"context_line":"    root.get(\u0027capabilities\u0027, {}) value can either be a dict, or a json str, or"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_da078517","line":486,"in_reply_to":"df33271e_e5abd2d2","updated":"2020-04-02 16:04:33.000000000","message":"move with this change or later?\nalso: could you elaborate on \"cannot be done in Ussuri\", please?","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":522,"context_line":"# 1. node is a dict, not an ironic.objects.node"},{"line_number":523,"context_line":"# 2. implicit bios boot mode when using trusted boot capability is removed:"},{"line_number":524,"context_line":"# there is no reason why trusted_boot should imply bios boot mode."},{"line_number":525,"context_line":"def get_node_boot_mode(node):"},{"line_number":526,"context_line":"    \"\"\"Returns the node boot mode."},{"line_number":527,"context_line":""},{"line_number":528,"context_line":"    It returns \u0027uefi\u0027 if \u0027secure_boot\u0027 is set to \u0027true\u0027 in"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_45b71e3b","line":525,"updated":"2020-04-02 08:20:09.000000000","message":"ditto","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":562,"context_line":"    return boot_mode"},{"line_number":563,"context_line":""},{"line_number":564,"context_line":""},{"line_number":565,"context_line":"def get_partition_table_type_from_specs(node):"},{"line_number":566,"context_line":"    \"\"\"Returns the node partition label, gpt or msdos."},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"    If boot mode is uefi, return gpt. Else, choice is open, look for"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_85864665","line":565,"updated":"2020-04-02 08:20:09.000000000","message":"ditto","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":596,"context_line":"    :param device_name: the name of the device"},{"line_number":597,"context_line":"    :return: msdos, gpt or unknown"},{"line_number":598,"context_line":"    \"\"\""},{"line_number":599,"context_line":"    out, _u \u003d execute(\u0027parted\u0027, \u0027-s\u0027, device, \u0027--\u0027, \u0027print\u0027)"},{"line_number":600,"context_line":"    out \u003d out.splitlines()"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"    for line in out:"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_059a36b7","line":599,"updated":"2020-04-02 08:20:09.000000000","message":"nit: do you want to handle exceptions here?","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":596,"context_line":"    :param device_name: the name of the device"},{"line_number":597,"context_line":"    :return: msdos, gpt or unknown"},{"line_number":598,"context_line":"    \"\"\""},{"line_number":599,"context_line":"    out, _u \u003d execute(\u0027parted\u0027, \u0027-s\u0027, device, \u0027--\u0027, \u0027print\u0027)"},{"line_number":600,"context_line":"    out \u003d out.splitlines()"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"    for line in out:"}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_7a3c7992","line":599,"in_reply_to":"df33271e_059a36b7","updated":"2020-04-02 16:04:33.000000000","message":"Not sure how to handle an exception tbh ... it seems like the code is expected to work even on devices w/o a partition table ... so if you don\u0027t mind, I would leave it like this and fix in case there is an issue.","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"eb0c17470bb2da25854949e44f8fb0242ddb0442","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return m.group(1)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    msg \u003d \"Unable to get partition table type for device {}\".format(device)"},{"line_number":608,"context_line":"    LOG.warning(msg)"},{"line_number":609,"context_line":""},{"line_number":610,"context_line":"    return \u0027unknown\u0027"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_c57cce73","line":608,"updated":"2020-04-02 08:20:09.000000000","message":"nit: do not pre-format strings for logging","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"},{"author":{"_account_id":11292,"name":"Arne Wiebalck","email":"Arne.Wiebalck@cern.ch","username":"wiebalck"},"change_message_id":"2a2937e3dbf5c3e91c16894ab06b3c656b24364e","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return m.group(1)"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"    msg \u003d \"Unable to get partition table type for device {}\".format(device)"},{"line_number":608,"context_line":"    LOG.warning(msg)"},{"line_number":609,"context_line":""},{"line_number":610,"context_line":"    return \u0027unknown\u0027"},{"line_number":611,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"df33271e_f1426f3d","line":608,"in_reply_to":"df33271e_c57cce73","updated":"2020-04-02 16:04:33.000000000","message":"Done","commit_id":"b689abdc555120163ff5fbf7270cf5ac4c5c9dd6"}],"releasenotes/notes/softraid-bootable-with-uefi-aa22e6cbaf1ea747.yaml":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"806f492732182bcbdfe01ebc0ebf7f747187c231","unresolved":false,"context_lines":[{"line_number":4,"context_line":"    boot mode by default. Can be overwritten in node specs"},{"line_number":5,"context_line":"    (instance_info or properties). According to what is currently used"},{"line_number":6,"context_line":"    on ironic side. Finally can be overriden with disk_label capability."},{"line_number":7,"context_line":"  - Install bootloader now supports softraid along with uefi."}],"source_content_type":"text/x-yaml","patch_set":2,"id":"3fa7e38b_555e4f51","line":7,"updated":"2020-01-23 10:02:14.000000000","message":"nit: Installing, software RAID, UEFI","commit_id":"e2d9534de2b8ef982987f1ac74881886598c9301"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"6a2264d1dce2d53082700ee153e383f5e4ca9730","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":5,"id":"1fa4df85_9f426f0e","line":8,"updated":"2020-03-09 14:26:06.000000000","message":"This should likely be restructured to something like \"Adds UEFI boot support for Software RAID, and for partition table creation based upon boot mode in use.\n\nAnd under under upgrades, make a note regarding the disk partition type logic.","commit_id":"b95c0af7ecfb2d95c066bd4e5e03f955a9d37558"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  |"},{"line_number":4,"context_line":"  - Adds UEFI boot support for Software RAID, and for partition table"},{"line_number":5,"context_line":"    creation based upon boot mode in use."},{"line_number":6,"context_line":"upgrade:"}],"source_content_type":"text/x-yaml","patch_set":11,"id":"df33271e_864727bd","line":3,"updated":"2020-04-06 08:50:22.000000000","message":"| goes after -, not before it, otherwise you\u0027re creating nested lists","commit_id":"9343348106b46377df8327dbb8f914266b150979"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"66b3c17524ea6351fa5ad8397070c0cd9e79c535","unresolved":false,"context_lines":[{"line_number":4,"context_line":"  - Adds UEFI boot support for Software RAID, and for partition table"},{"line_number":5,"context_line":"    creation based upon boot mode in use."},{"line_number":6,"context_line":"upgrade:"},{"line_number":7,"context_line":"  |"},{"line_number":8,"context_line":"  - The type of the partition table created for Software RAID is now based"},{"line_number":9,"context_line":"    upon the boot mode in use (GPT for UEFI or if explicitly passed via the"},{"line_number":10,"context_line":"    instance\u0027s capabilities or the node\u0027s properties, otherwise MSDOS)."}],"source_content_type":"text/x-yaml","patch_set":11,"id":"df33271e_6644a3b8","line":7,"updated":"2020-04-06 08:50:22.000000000","message":"ditto","commit_id":"9343348106b46377df8327dbb8f914266b150979"}]}
