)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"146226cd24b76af6ea48c01434b04628d6504306","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"abf364f2_6fc17d64","updated":"2024-01-19 18:51:28.000000000","message":"Significant style improvements suggestions, see inline.","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"f49d28de4fc13185f811ada4350c5e313baae11d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"82988b2b_fdb4bcf1","updated":"2023-10-20 11:54:11.000000000","message":"recheck\nnova-ceph-multistore bug #2039972 was reported\nnova-grenade-multinode SSH connectivity problems to VM","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"763e27c12c516cc8f61bcb8db65ef6860ccaccc3","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"4f16707c_c5d162c4","updated":"2023-10-20 15:29:47.000000000","message":"recheck\nnova-grenade-multinode sync command executed inside VM times out. Looks like sporadic/performance problem to me.","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"2f28737bfd466ce39208099bba52a9f1c7a18bb4","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"e1f467f2_a96e7e46","updated":"2023-10-24 11:47:36.000000000","message":"recheck\nnova-multi-cell -\u003e failure to SSH to instance in test_cold_migrate_unshelved_instance test\n\nnova-lvm -\u003e failure to create instance\u0027s snapshot because of SnapshotNotFoundException","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"314a11253b41bec07b9ff6718955b8ae7980715e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":7,"id":"926d5137_ffad9ae2","updated":"2023-10-20 09:03:41.000000000","message":"recheck\ntempest-integrated-compute-enforce-scope-new-defaults DB connectivity issues\nnova-lvm  SSH connection timeout for one of instances","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"}],"nova/virt/libvirt/imagecache.py":[{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"6d4e5723f843ee43c98cbb521cf4cfa59e5513e4","unresolved":true,"context_lines":[{"line_number":388,"context_line":"            return"},{"line_number":389,"context_line":"        return base_dir"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _find_problematic_images(self, context):"},{"line_number":392,"context_line":"        \"\"\"Find potentially problematic images that exist in local"},{"line_number":393,"context_line":"        image cache, don\u0027t fall under standard categories and should"},{"line_number":394,"context_line":"        not be removed."}],"source_content_type":"text/x-python","patch_set":5,"id":"5f31c0c8_3d984d88","line":391,"updated":"2023-04-13 13:49:28.000000000","message":"Please rename this to describe what it actually does. If we expand it later, we can rename it later, it\u0027s a private method.","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"99a78676848508e0edece330d03112bd83dfb2ec","unresolved":false,"context_lines":[{"line_number":388,"context_line":"            return"},{"line_number":389,"context_line":"        return base_dir"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _find_problematic_images(self, context):"},{"line_number":392,"context_line":"        \"\"\"Find potentially problematic images that exist in local"},{"line_number":393,"context_line":"        image cache, don\u0027t fall under standard categories and should"},{"line_number":394,"context_line":"        not be removed."}],"source_content_type":"text/x-python","patch_set":5,"id":"3c27967e_f94ac817","line":391,"in_reply_to":"5f31c0c8_3d984d88","updated":"2023-04-28 15:59:40.000000000","message":"Done","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"6d4e5723f843ee43c98cbb521cf4cfa59e5513e4","unresolved":true,"context_lines":[{"line_number":405,"context_line":"            \u0027status\u0027: \u0027error\u0027,"},{"line_number":406,"context_line":"            \u0027migration_type\u0027: fields.MigrationType.RESIZE"},{"line_number":407,"context_line":"        }"},{"line_number":408,"context_line":"        failed_resize_calls \u003d objects.MigrationList.get_by_filters("},{"line_number":409,"context_line":"            context, filters)"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        if failed_resize_calls:"}],"source_content_type":"text/x-python","patch_set":5,"id":"a713a182_9be8d151","line":408,"updated":"2023-04-13 13:49:28.000000000","message":"failed_resize_migrations please, these aren\u0027t calls :)","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"99a78676848508e0edece330d03112bd83dfb2ec","unresolved":false,"context_lines":[{"line_number":405,"context_line":"            \u0027status\u0027: \u0027error\u0027,"},{"line_number":406,"context_line":"            \u0027migration_type\u0027: fields.MigrationType.RESIZE"},{"line_number":407,"context_line":"        }"},{"line_number":408,"context_line":"        failed_resize_calls \u003d objects.MigrationList.get_by_filters("},{"line_number":409,"context_line":"            context, filters)"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"        if failed_resize_calls:"}],"source_content_type":"text/x-python","patch_set":5,"id":"3082a59a_44fe8588","line":408,"in_reply_to":"a713a182_9be8d151","updated":"2023-04-28 15:59:40.000000000","message":"Renamed to _find_images_for_failed_evacuations","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"6d4e5723f843ee43c98cbb521cf4cfa59e5513e4","unresolved":true,"context_lines":[{"line_number":414,"context_line":"            failed_resize_instance_uuids \u003d []"},{"line_number":415,"context_line":"            for mig in failed_resize_calls:"},{"line_number":416,"context_line":"                if mig.instance_uuid not in failed_resize_instance_uuids:"},{"line_number":417,"context_line":"                    failed_resize_instance_uuids.append(mig.instance_uuid)"},{"line_number":418,"context_line":"            # Get instances in ERROR state that have associated failed"},{"line_number":419,"context_line":"            # resize operations"},{"line_number":420,"context_line":"            filters \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"209b4052_58258ea3","line":417,"updated":"2023-04-13 13:49:28.000000000","message":"I think the following would work, and be more Pythonic:\n\n    failed_resize_instance_uuids \u003d set([migration.instance_uuid for migration in failed_resize_migrations])","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"99a78676848508e0edece330d03112bd83dfb2ec","unresolved":true,"context_lines":[{"line_number":414,"context_line":"            failed_resize_instance_uuids \u003d []"},{"line_number":415,"context_line":"            for mig in failed_resize_calls:"},{"line_number":416,"context_line":"                if mig.instance_uuid not in failed_resize_instance_uuids:"},{"line_number":417,"context_line":"                    failed_resize_instance_uuids.append(mig.instance_uuid)"},{"line_number":418,"context_line":"            # Get instances in ERROR state that have associated failed"},{"line_number":419,"context_line":"            # resize operations"},{"line_number":420,"context_line":"            filters \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"738c855b_a53d0e70","line":417,"in_reply_to":"209b4052_58258ea3","updated":"2023-04-28 15:59:40.000000000","message":"I actually wanted to do this originally, but ended up finding [1] when I tried to separate it properly for multiple lines... \n\n[1]\nhttps://stackoverflow.com/questions/1233448/no-multiline-lambda-in-python-why-not","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"71da1c70b3a269e91f2a4a429fb60d58695e7b78","unresolved":true,"context_lines":[{"line_number":414,"context_line":"            failed_resize_instance_uuids \u003d []"},{"line_number":415,"context_line":"            for mig in failed_resize_calls:"},{"line_number":416,"context_line":"                if mig.instance_uuid not in failed_resize_instance_uuids:"},{"line_number":417,"context_line":"                    failed_resize_instance_uuids.append(mig.instance_uuid)"},{"line_number":418,"context_line":"            # Get instances in ERROR state that have associated failed"},{"line_number":419,"context_line":"            # resize operations"},{"line_number":420,"context_line":"            filters \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"caa3ae30_5f1f3497","line":417,"in_reply_to":"738c855b_a53d0e70","updated":"2023-05-19 17:13:16.000000000","message":"I\u0027m not sure I understand, there\u0027s no lambda here, it\u0027s a list comprehension. Something like the following works:\n\n    foo \u003d set([\n      bar[0] for bar in [[\u0027a\u0027, \u0027b\u0027], [\u0027c\u0027]]                                                                             \n      if len(bar) \u003e 1])\n    print(foo)\n  \nPrints\n\n    {\u0027a\u0027}\n  \nJust using that as an example of splitting list comprehension across multiple lines.","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"bb3dcf74362343c3b432cc016e276990ae7bbddd","unresolved":false,"context_lines":[{"line_number":414,"context_line":"            failed_resize_instance_uuids \u003d []"},{"line_number":415,"context_line":"            for mig in failed_resize_calls:"},{"line_number":416,"context_line":"                if mig.instance_uuid not in failed_resize_instance_uuids:"},{"line_number":417,"context_line":"                    failed_resize_instance_uuids.append(mig.instance_uuid)"},{"line_number":418,"context_line":"            # Get instances in ERROR state that have associated failed"},{"line_number":419,"context_line":"            # resize operations"},{"line_number":420,"context_line":"            filters \u003d {"}],"source_content_type":"text/x-python","patch_set":5,"id":"34e89db0_d164a23a","line":417,"in_reply_to":"caa3ae30_5f1f3497","updated":"2023-10-18 18:45:51.000000000","message":"Done","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"6d4e5723f843ee43c98cbb521cf4cfa59e5513e4","unresolved":true,"context_lines":[{"line_number":430,"context_line":"                    continue"},{"line_number":431,"context_line":"                local, remote, insts \u003d resize_failed_images.get("},{"line_number":432,"context_line":"                    image_ref_str, (0, 0, []))"},{"line_number":433,"context_line":"                local +\u003d 1"},{"line_number":434,"context_line":"                insts.append(instance.uuid)"},{"line_number":435,"context_line":"                resize_failed_images[image_ref_str] \u003d (local, remote, insts)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"d09f6766_f861e789","line":433,"updated":"2023-04-13 13:49:28.000000000","message":"I have to admit to not understanding the local, remote, insts tuple here...","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"71da1c70b3a269e91f2a4a429fb60d58695e7b78","unresolved":true,"context_lines":[{"line_number":430,"context_line":"                    continue"},{"line_number":431,"context_line":"                local, remote, insts \u003d resize_failed_images.get("},{"line_number":432,"context_line":"                    image_ref_str, (0, 0, []))"},{"line_number":433,"context_line":"                local +\u003d 1"},{"line_number":434,"context_line":"                insts.append(instance.uuid)"},{"line_number":435,"context_line":"                resize_failed_images[image_ref_str] \u003d (local, remote, insts)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"f5486a81_7725ac35","line":433,"in_reply_to":"b940fdb5_343fc124","updated":"2023-05-19 17:13:16.000000000","message":"But... why? Do you even need the instance uuid at all in the final list of image_refs? The way you\u0027re consuming this information in the loop on L336 seems to indicate you only care about the list of image refs itself. So why not just have this method return the following:\n\n    return [instance.image_ref for instance in resize_failed_inst\n            if \u0027image_ref\u0027 in instance and instance.image_ref is not None]\n            \ndirectly on L424 and drop everything else?","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"99a78676848508e0edece330d03112bd83dfb2ec","unresolved":true,"context_lines":[{"line_number":430,"context_line":"                    continue"},{"line_number":431,"context_line":"                local, remote, insts \u003d resize_failed_images.get("},{"line_number":432,"context_line":"                    image_ref_str, (0, 0, []))"},{"line_number":433,"context_line":"                local +\u003d 1"},{"line_number":434,"context_line":"                insts.append(instance.uuid)"},{"line_number":435,"context_line":"                resize_failed_images[image_ref_str] \u003d (local, remote, insts)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"b940fdb5_343fc124","line":433,"in_reply_to":"d09f6766_f861e789","updated":"2023-04-28 15:59:40.000000000","message":"I tried to make it return the data in the same format as _list_running_instances to simplify possible integration. Maybe I tricked myself, please let me know what do you think...\n\nhttps://github.com/openstack/nova/blob/master/nova/virt/imagecache.py#L74","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"3080badd7c4c62a00b416d972e666dc7cdebd0ce","unresolved":false,"context_lines":[{"line_number":430,"context_line":"                    continue"},{"line_number":431,"context_line":"                local, remote, insts \u003d resize_failed_images.get("},{"line_number":432,"context_line":"                    image_ref_str, (0, 0, []))"},{"line_number":433,"context_line":"                local +\u003d 1"},{"line_number":434,"context_line":"                insts.append(instance.uuid)"},{"line_number":435,"context_line":"                resize_failed_images[image_ref_str] \u003d (local, remote, insts)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"d6551eca_01ba4a4e","line":433,"in_reply_to":"f5486a81_7725ac35","updated":"2023-10-18 18:45:07.000000000","message":"I oversmarted myself with these counters, they are not really needed. At the same time, we need to prepare and provide list of instances affected by this situation, so operator will be able to isolate the problem behind failed resize and address it. I improved the code a bit to remove useless information.","commit_id":"dcc3ed3d3a5c1b4e3c07bce5750c71a488ba6e36"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"71da1c70b3a269e91f2a4a429fb60d58695e7b78","unresolved":true,"context_lines":[{"line_number":388,"context_line":"            return"},{"line_number":389,"context_line":"        return base_dir"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _find_images_for_failed_evacuations(self, context):"},{"line_number":392,"context_line":"        \"\"\"Find potentially problematic images that exist in local image"},{"line_number":393,"context_line":"        cache and should not be removed. This method returns a list of"},{"line_number":394,"context_line":"        images associated with instances in ERROR state that have failed"}],"source_content_type":"text/x-python","patch_set":6,"id":"816dcc04_6d7692bb","line":391,"updated":"2023-05-19 17:13:16.000000000","message":"nit: evacuation means a different thing than resize","commit_id":"d754fd0d5bd4adc2a2908a6c356a56daebc514f9"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"3080badd7c4c62a00b416d972e666dc7cdebd0ce","unresolved":false,"context_lines":[{"line_number":388,"context_line":"            return"},{"line_number":389,"context_line":"        return base_dir"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _find_images_for_failed_evacuations(self, context):"},{"line_number":392,"context_line":"        \"\"\"Find potentially problematic images that exist in local image"},{"line_number":393,"context_line":"        cache and should not be removed. This method returns a list of"},{"line_number":394,"context_line":"        images associated with instances in ERROR state that have failed"}],"source_content_type":"text/x-python","patch_set":6,"id":"745ba165_1b6b6403","line":391,"in_reply_to":"816dcc04_6d7692bb","updated":"2023-10-18 18:45:07.000000000","message":"Done","commit_id":"d754fd0d5bd4adc2a2908a6c356a56daebc514f9"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"71da1c70b3a269e91f2a4a429fb60d58695e7b78","unresolved":true,"context_lines":[{"line_number":398,"context_line":"        # Obtain list of failed resize operations where local host is"},{"line_number":399,"context_line":"        # a source host."},{"line_number":400,"context_line":"        filters \u003d {"},{"line_number":401,"context_line":"            \u0027source_compute\u0027: CONF.host,"},{"line_number":402,"context_line":"            \u0027status\u0027: \u0027error\u0027,"},{"line_number":403,"context_line":"            \u0027migration_type\u0027: fields.MigrationType.RESIZE"},{"line_number":404,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"0151c544_a6be99e9","line":401,"updated":"2023-05-19 17:13:16.000000000","message":"I was trying to think of instances where CONF.host might _not_ be the correct hostname for ourselves, but I think we\u0027re good.","commit_id":"d754fd0d5bd4adc2a2908a6c356a56daebc514f9"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"3080badd7c4c62a00b416d972e666dc7cdebd0ce","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        # Obtain list of failed resize operations where local host is"},{"line_number":399,"context_line":"        # a source host."},{"line_number":400,"context_line":"        filters \u003d {"},{"line_number":401,"context_line":"            \u0027source_compute\u0027: CONF.host,"},{"line_number":402,"context_line":"            \u0027status\u0027: \u0027error\u0027,"},{"line_number":403,"context_line":"            \u0027migration_type\u0027: fields.MigrationType.RESIZE"},{"line_number":404,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":6,"id":"e4ac7d5f_57b79270","line":401,"in_reply_to":"0151c544_a6be99e9","updated":"2023-10-18 18:45:07.000000000","message":"From my perspective it is correct way to get hypervisor\u0027s hostname: this option is either defined or defaults to socket.gethostname(). We use it in multiple places already, so looks safe to me.","commit_id":"d754fd0d5bd4adc2a2908a6c356a56daebc514f9"},{"author":{"_account_id":19234,"name":"Alexey Stupnikov","email":"aleksey.stupnikov@gmail.com","username":"astupnikov"},"change_message_id":"3080badd7c4c62a00b416d972e666dc7cdebd0ce","unresolved":false,"context_lines":[{"line_number":411,"context_line":"            failed_resize_instance_uuids \u003d []"},{"line_number":412,"context_line":"            for mig in failed_resize_migrations:"},{"line_number":413,"context_line":"                if mig.instance_uuid not in failed_resize_instance_uuids:"},{"line_number":414,"context_line":"                    failed_resize_instance_uuids.append(mig.instance_uuid)"},{"line_number":415,"context_line":"            # Get instances in ERROR state that have associated failed"},{"line_number":416,"context_line":"            # resize operations"},{"line_number":417,"context_line":"            filters \u003d {"}],"source_content_type":"text/x-python","patch_set":6,"id":"845fabd4_b570355f","line":414,"range":{"start_line":414,"start_character":0,"end_line":414,"end_character":74},"updated":"2023-10-18 18:45:07.000000000","message":"Ack, thanks for explanation. Fixed this.","commit_id":"d754fd0d5bd4adc2a2908a6c356a56daebc514f9"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"146226cd24b76af6ea48c01434b04628d6504306","unresolved":true,"context_lines":[{"line_number":392,"context_line":"        \"\"\"Find potentially problematic images that exist in local image"},{"line_number":393,"context_line":"        cache and should not be removed. This method returns a list of"},{"line_number":394,"context_line":"        images associated with instances in ERROR state that have failed"},{"line_number":395,"context_line":"        resize operations from local compute node."},{"line_number":396,"context_line":"        \"\"\""},{"line_number":397,"context_line":"        resize_failed_images \u003d {}"},{"line_number":398,"context_line":"        # Obtain list of failed resize operations where local host is"}],"source_content_type":"text/x-python","patch_set":7,"id":"d16c03d3_f81f9318","line":395,"updated":"2024-01-19 18:51:28.000000000","message":"You should add a :return: here, since it\u0027s not clear until the very end that you\u0027re returning a dict of instances keyed by image ID.","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"146226cd24b76af6ea48c01434b04628d6504306","unresolved":true,"context_lines":[{"line_number":394,"context_line":"        images associated with instances in ERROR state that have failed"},{"line_number":395,"context_line":"        resize operations from local compute node."},{"line_number":396,"context_line":"        \"\"\""},{"line_number":397,"context_line":"        resize_failed_images \u003d {}"},{"line_number":398,"context_line":"        # Obtain list of failed resize operations where local host is"},{"line_number":399,"context_line":"        # a source host."},{"line_number":400,"context_line":"        filters \u003d {"}],"source_content_type":"text/x-python","patch_set":7,"id":"78428b11_7c77ee6b","line":397,"updated":"2024-01-19 18:51:28.000000000","message":"You should move this down closer to where you use it (~L420), and make this a `collections.defaultdict(list)`. See below for why.","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"},{"author":{"_account_id":8864,"name":"Artom Lifshitz","email":"notartom@gmail.com","username":"artom"},"change_message_id":"146226cd24b76af6ea48c01434b04628d6504306","unresolved":true,"context_lines":[{"line_number":421,"context_line":"                context, filters)"},{"line_number":422,"context_line":"            for instance in resize_failed_inst:"},{"line_number":423,"context_line":"                image_ref_str \u003d getattr(instance, \u0027image_ref\u0027)"},{"line_number":424,"context_line":"                if image_ref_str is None:"},{"line_number":425,"context_line":"                    continue"},{"line_number":426,"context_line":"                affected_instances \u003d resize_failed_images.get("},{"line_number":427,"context_line":"                    image_ref_str, [])"}],"source_content_type":"text/x-python","patch_set":7,"id":"4ed80330_d752e15a","line":424,"updated":"2024-01-19 18:51:28.000000000","message":"With `resize_failed_images` a `collections.defaultdict(list)`, everything below becomes:\n\n\n    if image_ref_str:\n        resize_failed_images[image_ref_str].append(instance.uuid)\n        \n        \nThat loses the weird `continue`, and allows the `defaultdict(list)` of doing the work of creating the empty list when the key is accessed for the fist time.","commit_id":"dda1d145c2824a3d9241f0e1fbaa8b638be3e610"}]}
