)]}'
{"nova/cells/messaging.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"            except exception.InstanceNotFound:"},{"line_number":1026,"context_line":"                # FIXME(comstud): Strange.  Need to handle quotas here,"},{"line_number":1027,"context_line":"                # if we actually want this code to remain.."},{"line_number":1028,"context_line":"                # FIXME(danms): When is this ever just going to work?"},{"line_number":1029,"context_line":"                # instance.create()"},{"line_number":1030,"context_line":"                instance.create()"},{"line_number":1031,"context_line":"                # FIXME(melwitt): Do we still want to add this logging?"},{"line_number":1032,"context_line":"                LOG.warning(_LW(\u0027Unable to save non-existent instance at top\u0027),"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_1dbdedd7","line":1029,"range":{"start_line":1028,"start_character":16,"end_line":1029,"end_character":35},"updated":"2017-01-24 02:15:58.000000000","message":"We should remove this if you\u0027re cool with what I did (keep the instance.create() here).","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ecc18fd1a8b488c2f3234c85863483899070b10f","unresolved":false,"context_lines":[{"line_number":1025,"context_line":"            except exception.InstanceNotFound:"},{"line_number":1026,"context_line":"                # FIXME(comstud): Strange.  Need to handle quotas here,"},{"line_number":1027,"context_line":"                # if we actually want this code to remain.."},{"line_number":1028,"context_line":"                # FIXME(danms): When is this ever just going to work?"},{"line_number":1029,"context_line":"                # instance.create()"},{"line_number":1030,"context_line":"                instance.create()"},{"line_number":1031,"context_line":"                # FIXME(melwitt): Do we still want to add this logging?"},{"line_number":1032,"context_line":"                LOG.warning(_LW(\u0027Unable to save non-existent instance at top\u0027),"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_a69d85bd","line":1029,"range":{"start_line":1028,"start_character":16,"end_line":1029,"end_character":35},"in_reply_to":"5a3905b3_1dbdedd7","updated":"2017-01-24 16:04:44.000000000","message":"Yeah, this was just stabbing in the dark on something.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"                # FIXME(danms): When is this ever just going to work?"},{"line_number":1029,"context_line":"                # instance.create()"},{"line_number":1030,"context_line":"                instance.create()"},{"line_number":1031,"context_line":"                # FIXME(melwitt): Do we still want to add this logging?"},{"line_number":1032,"context_line":"                LOG.warning(_LW(\u0027Unable to save non-existent instance at top\u0027),"},{"line_number":1033,"context_line":"                            instance\u003dinstance)"},{"line_number":1034,"context_line":"            except exception.NotFound:"},{"line_number":1035,"context_line":"                # Can happen if we try to update a deleted instance\u0027s"},{"line_number":1036,"context_line":"                # network information, for example."}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_bdccd989","line":1033,"range":{"start_line":1031,"start_character":16,"end_line":1033,"end_character":46},"updated":"2017-01-24 02:15:58.000000000","message":"Question for you from last week, do we want to keep this logging? If so, should it be debug level probably?","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"}],"nova/compute/api.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c311a202b2383519aafd98bb3ffc0d49cfa9d6e1","unresolved":false,"context_lines":[{"line_number":1150,"context_line":"        instances \u003d [build_req.instance for build_req in build_requests]"},{"line_number":1151,"context_line":""},{"line_number":1152,"context_line":"        for instance in instances:"},{"line_number":1153,"context_line":"            self._record_action_start(context, instance,"},{"line_number":1154,"context_line":"                                      instance_actions.CREATE)"},{"line_number":1155,"context_line":""},{"line_number":1156,"context_line":"        self.compute_task_api.schedule_and_build_instances(context,"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_94a924e2","line":1153,"updated":"2016-09-06 17:02:50.000000000","message":"This fails due to a foreign key constraint on the instances table and needs to be moved to the conductor.","commit_id":"2cca75d99ed8855a49a58e6343de564b931db2f5"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":983,"context_line":"                        instance_type, boot_meta, instance, security_groups,"},{"line_number":984,"context_line":"                        block_device_mapping, num_instances, i,"},{"line_number":985,"context_line":"                        shutdown_terminate, create_instance\u003dFalse)"},{"line_number":986,"context_line":"                block_device_mapping \u003d ("},{"line_number":987,"context_line":"                    self._bdm_validate_set_size_and_instance(context,"},{"line_number":988,"context_line":"                        instance, instance_type, block_device_mapping))"},{"line_number":989,"context_line":""},{"line_number":990,"context_line":"                # NOTE(danms): BDMs are still not created, so we need to pass"},{"line_number":991,"context_line":"                # a clone and then reset them on our object after create so"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_7da19145","line":988,"range":{"start_line":986,"start_character":16,"end_line":988,"end_character":71},"updated":"2017-01-24 02:15:58.000000000","message":"_validate_bdm called here","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        build_requests \u003d []"},{"line_number":1222,"context_line":"        for rs, build_request, im in instances_to_build:"},{"line_number":1223,"context_line":"            build_requests.append(build_request)"},{"line_number":1224,"context_line":"            # FIXME(melwitt): We need get_new_instance here for cells v1."},{"line_number":1225,"context_line":"            # Is this okay for cells v2 too? I saw conductor also calls it."},{"line_number":1226,"context_line":"            instance \u003d build_request.get_new_instance(context)"},{"line_number":1227,"context_line":"            instances.append(instance)"},{"line_number":1228,"context_line":"            request_specs.append(rs)"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_5ddcd545","line":1225,"range":{"start_line":1224,"start_character":12,"end_line":1225,"end_character":75},"updated":"2017-01-24 02:15:58.000000000","message":"Just a reminder that this is here, as a question to you. From what I can tell, it should be fine to use \u0027get_new_instance\u0027 in either case because all it does is return a dirtied self.instance for use in the create.\n\nIf that\u0027s all fine, we can just remove this comment.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ecc18fd1a8b488c2f3234c85863483899070b10f","unresolved":false,"context_lines":[{"line_number":1221,"context_line":"        build_requests \u003d []"},{"line_number":1222,"context_line":"        for rs, build_request, im in instances_to_build:"},{"line_number":1223,"context_line":"            build_requests.append(build_request)"},{"line_number":1224,"context_line":"            # FIXME(melwitt): We need get_new_instance here for cells v1."},{"line_number":1225,"context_line":"            # Is this okay for cells v2 too? I saw conductor also calls it."},{"line_number":1226,"context_line":"            instance \u003d build_request.get_new_instance(context)"},{"line_number":1227,"context_line":"            instances.append(instance)"},{"line_number":1228,"context_line":"            request_specs.append(rs)"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_46c86155","line":1225,"range":{"start_line":1224,"start_character":12,"end_line":1225,"end_character":75},"in_reply_to":"5a3905b3_5ddcd545","updated":"2017-01-24 16:04:44.000000000","message":"Yep, this just assembles an instance object from the parts in the BR, and can be re-run with the same result.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"            instance \u003d build_request.get_new_instance(context)"},{"line_number":1227,"context_line":"            instances.append(instance)"},{"line_number":1228,"context_line":"            request_specs.append(rs)"},{"line_number":1229,"context_line":"            self._validate_bdm("},{"line_number":1230,"context_line":"                context, instance, instance_type, block_device_mapping)"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"        if CONF.cells.enable:"},{"line_number":1233,"context_line":"            # NOTE(danms): CellsV1 can\u0027t do the new thing, so we"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_dda9a525","line":1230,"range":{"start_line":1229,"start_character":12,"end_line":1230,"end_character":71},"updated":"2017-01-24 02:15:58.000000000","message":"I think we discussed this before but why do we need to _validate_bdm twice?","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ecc18fd1a8b488c2f3234c85863483899070b10f","unresolved":false,"context_lines":[{"line_number":1226,"context_line":"            instance \u003d build_request.get_new_instance(context)"},{"line_number":1227,"context_line":"            instances.append(instance)"},{"line_number":1228,"context_line":"            request_specs.append(rs)"},{"line_number":1229,"context_line":"            self._validate_bdm("},{"line_number":1230,"context_line":"                context, instance, instance_type, block_device_mapping)"},{"line_number":1231,"context_line":""},{"line_number":1232,"context_line":"        if CONF.cells.enable:"},{"line_number":1233,"context_line":"            # NOTE(danms): CellsV1 can\u0027t do the new thing, so we"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_a61ae57a","line":1230,"range":{"start_line":1229,"start_character":12,"end_line":1230,"end_character":71},"in_reply_to":"5a3905b3_dda9a525","updated":"2017-01-24 16:04:44.000000000","message":"Yeah, we did. I think that I took it out and the resulting failure pointed to why it matters. Since we did, if it\u0027s cool, let me stack a change on top of this to remove it and re-poke the issue and if we want to resolve it we can do so in that patch. Is that cool?","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":2516,"context_line":"        global CELLS"},{"line_number":2517,"context_line":"        if not CELLS:"},{"line_number":2518,"context_line":"            CELLS \u003d objects.CellMappingList.get_all(context)"},{"line_number":2519,"context_line":"            LOG.debug(\u0027Found %(count)i cells: %(cells)s\u0027,"},{"line_number":2520,"context_line":"                      dict(count\u003dlen(CELLS), cells\u003dCELLS))"},{"line_number":2521,"context_line":""},{"line_number":2522,"context_line":"        if not CELLS:"},{"line_number":2523,"context_line":"            LOG.error(_LE(\u0027No cells are configured, unable to list instances\u0027))"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_ddf0c5cb","line":2520,"range":{"start_line":2519,"start_character":12,"end_line":2520,"end_character":58},"updated":"2017-01-24 02:15:58.000000000","message":"Probably want to remove this, no?","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ab767a5ba5fd42efeca1f48e587739f2fcde32e7","unresolved":false,"context_lines":[{"line_number":981,"context_line":"                    instance.keypairs.objects.append(key_pair)"},{"line_number":982,"context_line":"                instance \u003d self.create_db_entry_for_new_instance(context,"},{"line_number":983,"context_line":"                        instance_type, boot_meta, instance, security_groups,"},{"line_number":984,"context_line":"                        block_device_mapping, num_instances, i,"},{"line_number":985,"context_line":"                        shutdown_terminate, create_instance\u003dFalse)"},{"line_number":986,"context_line":"                block_device_mapping \u003d ("},{"line_number":987,"context_line":"                    self._bdm_validate_set_size_and_instance(context,"}],"source_content_type":"text/x-python","patch_set":73,"id":"5a3905b3_1a294ae6","line":984,"range":{"start_line":984,"start_character":61,"end_line":984,"end_character":62},"updated":"2017-01-24 17:11:50.000000000","message":"(I was wondering if we needed the boot index in the request spec too, but I guess that is here.)","commit_id":"d4ae4419adbd702191f30860c7e2c9df89ed0c0f"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"30324cae56a1cb527f91b9d41ac5fd672d4716af","unresolved":false,"context_lines":[{"line_number":1797,"context_line":"                # under us indicating the instance became scheduled"},{"line_number":1798,"context_line":"                # during the destroy(). Refresh the instance from the DB and"},{"line_number":1799,"context_line":"                # continue on with the delete logic for a scheduled instance."},{"line_number":1800,"context_line":"                instance.refresh()"},{"line_number":1801,"context_line":""},{"line_number":1802,"context_line":"        bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":1803,"context_line":"                context, instance.uuid)"}],"source_content_type":"text/x-python","patch_set":78,"id":"3a461143_3b7443ce","line":1800,"updated":"2017-01-25 15:08:11.000000000","message":"Does this need a context manager?\n\nI am a bit curious if we should really do a second destroyed, or double check its destroyed here too. I feel I am missing context here.","commit_id":"2bcf7aaddc7d24381c0c22a1628ddd77385ca198"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"f9edf0cc5613d539d176e72dd6bf7d585744831b","unresolved":false,"context_lines":[{"line_number":1800,"context_line":"                # NOTE(danms): If instance.host is set, we should be able to"},{"line_number":1801,"context_line":"                # do the following lookup. If not, there\u0027s not much we can"},{"line_number":1802,"context_line":"                # do to recover."},{"line_number":1803,"context_line":"                cell, instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1804,"context_line":"                if cell and instance:"},{"line_number":1805,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1806,"context_line":"                        instance.refresh()"}],"source_content_type":"text/x-python","patch_set":79,"id":"3a461143_4d96a795","line":1803,"updated":"2017-01-25 19:39:48.000000000","message":"Hm, does this not accomplish the refresh on its own? I\u0027m wondering if we even need to do anything with the context manager after looking up the instance.","commit_id":"7223d163d5ee945ff10d5257e1602e93f173e982"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5eda26605543263b23496cf495c53aff70ca9f90","unresolved":false,"context_lines":[{"line_number":1800,"context_line":"                # NOTE(danms): If instance.host is set, we should be able to"},{"line_number":1801,"context_line":"                # do the following lookup. If not, there\u0027s not much we can"},{"line_number":1802,"context_line":"                # do to recover."},{"line_number":1803,"context_line":"                cell, instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1804,"context_line":"                if cell and instance:"},{"line_number":1805,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1806,"context_line":"                        instance.refresh()"}],"source_content_type":"text/x-python","patch_set":79,"id":"3a461143_682b4e31","line":1803,"in_reply_to":"3a461143_4d96a795","updated":"2017-01-25 21:13:11.000000000","message":"It doesn\u0027t because instance may have had more stuff loaded, but since I eclipse the old one, the refresh is pointless. Since lazy loads won\u0027t actually consider the proper cell right now, I probably need to still do the refresh and not eclipse it. Not super efficient, but.. more is required to make that work properly anyway.","commit_id":"7223d163d5ee945ff10d5257e1602e93f173e982"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"92c483cfb3dbf79d8a6f7564cf04c2f36813f795","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"                cell, _instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1788,"context_line":"                if cell and _instance:"},{"line_number":1789,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1790,"context_line":"                        instance.destroy()"},{"line_number":1791,"context_line":"                        return"},{"line_number":1792,"context_line":"            except exception.ObjectActionError:"},{"line_number":1793,"context_line":"                # NOTE(melwitt): This means the instance.host changed"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_59949b36","line":1790,"updated":"2017-01-26 02:06:59.000000000","message":"Here\u0027s where the IBM CI failure happened when OrphanedObjectError was raised from here. How could instance be orphaned at this point?","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c880eb5378a125490a0d91a1c7ac7f5fd393d5f2","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"                cell, _instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1788,"context_line":"                if cell and _instance:"},{"line_number":1789,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1790,"context_line":"                        instance.destroy()"},{"line_number":1791,"context_line":"                        return"},{"line_number":1792,"context_line":"            except exception.ObjectActionError:"},{"line_number":1793,"context_line":"                # NOTE(melwitt): This means the instance.host changed"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_790cf794","line":1790,"in_reply_to":"3a461143_59949b36","updated":"2017-01-26 02:26:31.000000000","message":"Oh, the comment above explains it. This could be the case if the Instance object was pulled from a BuildRequest object. So the old code was doing a lookup of the real thing to make sure destroy() works. It looks like we need to put it back the way it was, or otherwise do something different depending on whether it\u0027s a real Instance or not.","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"63a0c8771437499a90d4cf7b3d38af0e5ec3596c","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"                cell, _instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1788,"context_line":"                if cell and _instance:"},{"line_number":1789,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1790,"context_line":"                        instance.destroy()"},{"line_number":1791,"context_line":"                        return"},{"line_number":1792,"context_line":"            except exception.ObjectActionError:"},{"line_number":1793,"context_line":"                # NOTE(melwitt): This means the instance.host changed"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_e43e7eb7","line":1790,"in_reply_to":"3a461143_59949b36","updated":"2017-01-26 02:26:40.000000000","message":"Yeah, it can\u0027t be orphaned AFAICT.","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7f04566a74cdf6efff1b17e6202694cffcddf0ba","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"                cell, _instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1788,"context_line":"                if cell and _instance:"},{"line_number":1789,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1790,"context_line":"                        instance.destroy()"},{"line_number":1791,"context_line":"                        return"},{"line_number":1792,"context_line":"            except exception.ObjectActionError:"},{"line_number":1793,"context_line":"                # NOTE(melwitt): This means the instance.host changed"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_a45d56eb","line":1790,"in_reply_to":"3a461143_790cf794","updated":"2017-01-26 02:33:48.000000000","message":"But, instance is created with a context in the buildrequest object and should not be orphaned:\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/build_request.py#L224","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"daace1a520cf886dc8a7f14f40fb58423c5fc27a","unresolved":false,"context_lines":[{"line_number":1787,"context_line":"                cell, _instance \u003d self._lookup_instance(context, instance.uuid)"},{"line_number":1788,"context_line":"                if cell and _instance:"},{"line_number":1789,"context_line":"                    with nova_context.target_cell(context, cell):"},{"line_number":1790,"context_line":"                        instance.destroy()"},{"line_number":1791,"context_line":"                        return"},{"line_number":1792,"context_line":"            except exception.ObjectActionError:"},{"line_number":1793,"context_line":"                # NOTE(melwitt): This means the instance.host changed"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_249de665","line":1790,"in_reply_to":"3a461143_a45d56eb","updated":"2017-01-26 02:38:21.000000000","message":"I thought the same initially but if you look at the error, it\u0027s definitely orphaned. I commented on L2286 on how it appears to be happening.","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"c880eb5378a125490a0d91a1c7ac7f5fd393d5f2","unresolved":false,"context_lines":[{"line_number":1803,"context_line":"                        # NOTE(danms): Still refresh the original instance"},{"line_number":1804,"context_line":"                        # because it may have had more stuff loaded that"},{"line_number":1805,"context_line":"                        # we want to refresh."},{"line_number":1806,"context_line":"                        instance.refresh()"},{"line_number":1807,"context_line":"            if not _instance:"},{"line_number":1808,"context_line":"                # Instance is already deleted."},{"line_number":1809,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_84577a01","line":1806,"updated":"2017-01-26 02:26:31.000000000","message":"Then here, should we just only do the lookup and not the refresh(), in the case of an Instance object that was generated from a BuildRequest?\n\nI\u0027m wondering if maybe it\u0027s better to just put all of this back the way you had it in PS79, minus the refresh() part.","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"daace1a520cf886dc8a7f14f40fb58423c5fc27a","unresolved":false,"context_lines":[{"line_number":2281,"context_line":"            # a cell yet. For now it also may mean that the deployer"},{"line_number":2282,"context_line":"            # has not created their cell(s) yet."},{"line_number":2283,"context_line":"            try:"},{"line_number":2284,"context_line":"                build_req \u003d objects.BuildRequest.get_by_instance_uuid("},{"line_number":2285,"context_line":"                        context, instance_uuid)"},{"line_number":2286,"context_line":"                instance \u003d build_req.instance"},{"line_number":2287,"context_line":"            except exception.BuildRequestNotFound:"},{"line_number":2288,"context_line":"                # Instance was mapped and the BuildRequest was deleted"},{"line_number":2289,"context_line":"                # while fetching. Try again."}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_44a112a9","line":2286,"range":{"start_line":2284,"start_character":16,"end_line":2286,"end_character":45},"updated":"2017-01-26 02:38:21.000000000","message":"I think this is the problem. When instance is pulled from a BuildRequest lookup (the topmost servers API always does a compute_api.get() of the instance before acting), it doesn\u0027t have a _context populated. At least AFAICT in the objects.BuildRequest.get_by_instance_uuid code.","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9d664ef138b9e3b6aca1aee926e6f5518157055e","unresolved":false,"context_lines":[{"line_number":2281,"context_line":"            # a cell yet. For now it also may mean that the deployer"},{"line_number":2282,"context_line":"            # has not created their cell(s) yet."},{"line_number":2283,"context_line":"            try:"},{"line_number":2284,"context_line":"                build_req \u003d objects.BuildRequest.get_by_instance_uuid("},{"line_number":2285,"context_line":"                        context, instance_uuid)"},{"line_number":2286,"context_line":"                instance \u003d build_req.instance"},{"line_number":2287,"context_line":"            except exception.BuildRequestNotFound:"},{"line_number":2288,"context_line":"                # Instance was mapped and the BuildRequest was deleted"},{"line_number":2289,"context_line":"                # while fetching. Try again."}],"source_content_type":"text/x-python","patch_set":81,"id":"3a461143_a4b556ce","line":2286,"range":{"start_line":2284,"start_character":16,"end_line":2286,"end_character":45},"in_reply_to":"3a461143_44a112a9","updated":"2017-01-26 02:40:17.000000000","message":"This is where _context gets set in the get_by_instance_uuid code:\n\nhttps://github.com/openstack/nova/blob/master/nova/objects/build_request.py#L144","commit_id":"7ab7ae2608a37e3a75794ec86d3df176bb58568b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3042998dd005774ad1e20129137c558b116a0f73","unresolved":false,"context_lines":[{"line_number":1685,"context_line":"                    # the cell, however InstanceNotFound means it\u0027s already"},{"line_number":1686,"context_line":"                    # deleted."},{"line_number":1687,"context_line":"                    return None, None"},{"line_number":1688,"context_line":"        return cell, instance"},{"line_number":1689,"context_line":""},{"line_number":1690,"context_line":"    def _delete_while_booting(self, context, instance):"},{"line_number":1691,"context_line":"        \"\"\"Handle deletion if the instance has not reached a cell yet"}],"source_content_type":"text/x-python","patch_set":83,"id":"3a461143_abeef71f","line":1688,"updated":"2017-01-26 11:20:56.000000000","message":"it could have been a separate bottom patch, but meh.","commit_id":"a095d5d00ec29575997289d79e25f757cf4f92fd"}],"nova/conductor/manager.py":[{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"ae048d83e7dfd2db3e87990b36f32fb154e8a68f","unresolved":false,"context_lines":[{"line_number":763,"context_line":"                updates \u003d {\u0027vm_state\u0027: vm_states.ERROR, \u0027task_state\u0027: None}"},{"line_number":764,"context_line":""},{"line_number":765,"context_line":"                if cellsv2:"},{"line_number":766,"context_line":"                    with nova_context.target_cell(context, cell_mapping):"},{"line_number":767,"context_line":"                        instance.create()"},{"line_number":768,"context_line":"                        self._set_vm_state_and_notify("},{"line_number":769,"context_line":"                            context, instance.uuid, \u0027build_instances\u0027, updates,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_9a26a814","line":766,"updated":"2016-09-01 15:44:09.000000000","message":"with example from L793 it can be done without code duplicating","commit_id":"2cca75d99ed8855a49a58e6343de564b931db2f5"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"ae048d83e7dfd2db3e87990b36f32fb154e8a68f","unresolved":false,"context_lines":[{"line_number":790,"context_line":"                # will fall back to assuming a database is configured and can"},{"line_number":791,"context_line":"                # be used. This will be an error in the future."},{"line_number":792,"context_line":"                host_mapping \u003d None"},{"line_number":793,"context_line":"            self._try_target_cell(context, host_mapping, instance.create)"},{"line_number":794,"context_line":"            instance_bdms \u003d self._try_target_cell("},{"line_number":795,"context_line":"                context, host_mapping, self._create_block_device_mapping,"},{"line_number":796,"context_line":"                instance.flavor, instance.uuid, block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_faedf4b7","line":793,"updated":"2016-09-01 15:44:09.000000000","message":"nit:\nThis call is ... unordinary.\nThe info is hidden here we call instance.create with the cell from host mapping.\nIt\u0027s clearer IMO to make something like:\nwith optional_context(host_mapping) as context:\n   instance.create()\n\nquestion:\nwill instance.create() be used in with correct context.\nI thought it must be:\ninstance \u003d objects.Instance(context\u003dcontext) \nor\ninstance._context \u003d context","commit_id":"2cca75d99ed8855a49a58e6343de564b931db2f5"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a2b06d1c2bb382d34fe156766743fbabef708a99","unresolved":false,"context_lines":[{"line_number":790,"context_line":"                # will fall back to assuming a database is configured and can"},{"line_number":791,"context_line":"                # be used. This will be an error in the future."},{"line_number":792,"context_line":"                host_mapping \u003d None"},{"line_number":793,"context_line":"            self._try_target_cell(context, host_mapping, instance.create)"},{"line_number":794,"context_line":"            instance_bdms \u003d self._try_target_cell("},{"line_number":795,"context_line":"                context, host_mapping, self._create_block_device_mapping,"},{"line_number":796,"context_line":"                instance.flavor, instance.uuid, block_device_mapping)"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_4799ab1e","line":793,"in_reply_to":"fa7ab95a_faedf4b7","updated":"2016-09-06 19:18:28.000000000","message":"You\u0027re right, we\u0027re missing a piece here. It should be:\n\n    with nova_context.target_cell(...) as cell_ctxt:\n        with instance.obj_alternate_context(ctxt):\n            instance.create()","commit_id":"2cca75d99ed8855a49a58e6343de564b931db2f5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3042998dd005774ad1e20129137c558b116a0f73","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                        # NOTE(melwitt): Instance became scheduled during"},{"line_number":938,"context_line":"                        # the destroy, \"host changed\". Refresh and re-destroy."},{"line_number":939,"context_line":"                        try:"},{"line_number":940,"context_line":"                            instance.refresh()"},{"line_number":941,"context_line":"                            instance.destroy()"},{"line_number":942,"context_line":"                        except exception.InstanceNotFound:"},{"line_number":943,"context_line":"                            pass"}],"source_content_type":"text/x-python","patch_set":83,"id":"3a461143_eb5d5fea","line":940,"updated":"2017-01-26 11:20:56.000000000","message":"not sure I get why we need to refresh the instance if we delete it just after, but okay, I can just ask later on.","commit_id":"a095d5d00ec29575997289d79e25f757cf4f92fd"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"edd808f8f849c7094ed9b128dcb9387e953b77bb","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                        # NOTE(melwitt): Instance became scheduled during"},{"line_number":938,"context_line":"                        # the destroy, \"host changed\". Refresh and re-destroy."},{"line_number":939,"context_line":"                        try:"},{"line_number":940,"context_line":"                            instance.refresh()"},{"line_number":941,"context_line":"                            instance.destroy()"},{"line_number":942,"context_line":"                        except exception.InstanceNotFound:"},{"line_number":943,"context_line":"                            pass"}],"source_content_type":"text/x-python","patch_set":83,"id":"3a461143_b3473a4a","line":940,"in_reply_to":"3a461143_7d304a57","updated":"2017-01-26 16:59:45.000000000","message":"ObjectActionError is raised if instance.host \u003d None and the column field is found to be non NULL in the db. So simply retrying the destroy without a refresh first, would result in ObjectActionError being raised again I think.","commit_id":"a095d5d00ec29575997289d79e25f757cf4f92fd"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5b40e7e74fe088d461bacca5bf5d0a4c98ce3a77","unresolved":false,"context_lines":[{"line_number":937,"context_line":"                        # NOTE(melwitt): Instance became scheduled during"},{"line_number":938,"context_line":"                        # the destroy, \"host changed\". Refresh and re-destroy."},{"line_number":939,"context_line":"                        try:"},{"line_number":940,"context_line":"                            instance.refresh()"},{"line_number":941,"context_line":"                            instance.destroy()"},{"line_number":942,"context_line":"                        except exception.InstanceNotFound:"},{"line_number":943,"context_line":"                            pass"}],"source_content_type":"text/x-python","patch_set":83,"id":"3a461143_7d304a57","line":940,"in_reply_to":"3a461143_eb5d5fea","updated":"2017-01-26 14:35:52.000000000","message":"Destroy might fail if we are out of sync, so sync back up and try again. Makes sense I think.","commit_id":"a095d5d00ec29575997289d79e25f757cf4f92fd"}],"nova/conductor/rpcapi.py":[{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"ae048d83e7dfd2db3e87990b36f32fb154e8a68f","unresolved":false,"context_lines":[{"line_number":347,"context_line":"        cctxt \u003d self.client.prepare(version\u003dversion)"},{"line_number":348,"context_line":"        cctxt.cast(context, \u0027build_instances\u0027, **kw)"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    def scheduled_and_build_instances(self, context, build_requests,"},{"line_number":351,"context_line":"                                      request_spec, filter_properties,"},{"line_number":352,"context_line":"                                      image, admin_password, injected_files,"},{"line_number":353,"context_line":"                                      requested_networks,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_bf1b5e1b","line":350,"updated":"2016-09-01 15:44:09.000000000","message":"typo s/scheduled/schedule","commit_id":"2cca75d99ed8855a49a58e6343de564b931db2f5"}],"nova/tests/functional/integrated_helpers.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ab767a5ba5fd42efeca1f48e587739f2fcde32e7","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                    break"},{"line_number":226,"context_line":"            except client.OpenStackApiNotFoundException:"},{"line_number":227,"context_line":"                # can be due instance creation are moved to conductor"},{"line_number":228,"context_line":"                # and nova-api service minimum version \u003c 15"},{"line_number":229,"context_line":"                pass"},{"line_number":230,"context_line":"            retry_count +\u003d 1"},{"line_number":231,"context_line":"            if retry_count \u003d\u003d max_retries:"}],"source_content_type":"text/x-python","patch_set":73,"id":"5a3905b3_75d501e3","line":228,"updated":"2017-01-24 17:11:50.000000000","message":"I\u0027ll be honest, this feels like a bad API break. I would love to avoid that one. I am probably missing context?","commit_id":"d4ae4419adbd702191f30860c7e2c9df89ed0c0f"}],"nova/tests/functional/wsgi/test_servers.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3042998dd005774ad1e20129137c558b116a0f73","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.api \u003d api_fixture.api"},{"line_number":46,"context_line":"        self.api.microversion \u003d \u0027latest\u0027"},{"line_number":47,"context_line":"        self.useFixture(nova_fixtures.SingleCellSimple())"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def test_instance_from_buildrequest(self):"},{"line_number":50,"context_line":"        self.useFixture(nova_fixtures.AllServicesCurrent())"}],"source_content_type":"text/x-python","patch_set":83,"id":"3a461143_2b93e75c","line":47,"updated":"2017-01-26 11:20:56.000000000","message":"you could have either explained in the commit msg why you need to use a single cell for this TestCase or having it done by a previous separate change, but meh, it\u0027s a nit because I understand why you do this.","commit_id":"a095d5d00ec29575997289d79e25f757cf4f92fd"}],"nova/tests/unit/api/openstack/compute/test_block_device_mapping_v1.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            override_controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            self.controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":100,"context_line":"        mock_validate_bdm.assert_called_with("},{"line_number":101,"context_line":"            test.MatchType(fakes.FakeRequestContext),"},{"line_number":102,"context_line":"            test.MatchType(objects.Instance),"},{"line_number":103,"context_line":"            test.MatchType(objects.Flavor),"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_7dad119a","line":100,"range":{"start_line":100,"start_character":8,"end_line":100,"end_character":45},"updated":"2017-01-24 02:15:58.000000000","message":"This is because it\u0027s called twice now instead of once.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7528db8dcccae9d39b1766927a6ecfa6ac1e92eb","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            override_controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            self.controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":100,"context_line":"        mock_validate_bdm.assert_called_with("},{"line_number":101,"context_line":"            test.MatchType(fakes.FakeRequestContext),"},{"line_number":102,"context_line":"            test.MatchType(objects.Instance),"},{"line_number":103,"context_line":"            test.MatchType(objects.Flavor),"}],"source_content_type":"text/x-python","patch_set":77,"id":"5a3905b3_c5b435d6","line":100,"updated":"2017-01-24 22:01:45.000000000","message":"This change should no longer be needed.","commit_id":"09e4325c00dd39c4d9dc6da94e546538a263067a"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"19af823cbd76eda2987fe16bb527e97c1e9abe45","unresolved":false,"context_lines":[{"line_number":97,"context_line":"            override_controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":98,"context_line":"        else:"},{"line_number":99,"context_line":"            self.controller.create(req, body\u003dbody).obj[\u0027server\u0027]"},{"line_number":100,"context_line":"        mock_validate_bdm.assert_called_with("},{"line_number":101,"context_line":"            test.MatchType(fakes.FakeRequestContext),"},{"line_number":102,"context_line":"            test.MatchType(objects.Instance),"},{"line_number":103,"context_line":"            test.MatchType(objects.Flavor),"}],"source_content_type":"text/x-python","patch_set":77,"id":"5a3905b3_c119847b","line":100,"in_reply_to":"5a3905b3_c5b435d6","updated":"2017-01-24 23:41:08.000000000","message":"Doh, yeah thanks.","commit_id":"09e4325c00dd39c4d9dc6da94e546538a263067a"}],"nova/tests/unit/compute/test_compute.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"ebcd88f6e81c12c388785caaa01629bf8d320fdc","unresolved":false,"context_lines":[{"line_number":7934,"context_line":"        (refs, resv_id) \u003d self.compute_api.create(self.context, inst_type,"},{"line_number":7935,"context_line":"                                                  self.fake_image[\u0027id\u0027])"},{"line_number":7936,"context_line":""},{"line_number":7937,"context_line":"        # TODO(avolkov): move this test to functional area"},{"line_number":7938,"context_line":"        # cause bdm is created in conductor method now"},{"line_number":7939,"context_line":""},{"line_number":7940,"context_line":"        # instance_uuid \u003d refs[0][\u0027uuid\u0027]"},{"line_number":7941,"context_line":"        # bdms \u003d block_device_obj.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":7942,"context_line":"        #     self.context, instance_uuid)"},{"line_number":7943,"context_line":""},{"line_number":7944,"context_line":"        # ephemeral \u003d list(filter(block_device.new_format_is_ephemeral, bdms))"},{"line_number":7945,"context_line":"        # self.assertEqual(1, len(ephemeral))"},{"line_number":7946,"context_line":"        # swap \u003d list(filter(block_device.new_format_is_swap, bdms))"},{"line_number":7947,"context_line":"        # self.assertEqual(1, len(swap))"},{"line_number":7948,"context_line":""},{"line_number":7949,"context_line":"        # self.assertEqual(1024, swap[0].volume_size)"},{"line_number":7950,"context_line":"        # self.assertEqual(1, ephemeral[0].volume_size)"},{"line_number":7951,"context_line":""},{"line_number":7952,"context_line":"    def test_create_with_deleted_image(self):"},{"line_number":7953,"context_line":"        # If we\u0027re given a deleted image by glance, we should not be able to"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_5d8135fa","line":7950,"range":{"start_line":7937,"start_character":6,"end_line":7950,"end_character":55},"updated":"2017-01-24 02:15:58.000000000","message":"Looks like this part needs to be moved? Or otherwise find a way to cover this. If it\u0027s already covered, we can remove it.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ecc18fd1a8b488c2f3234c85863483899070b10f","unresolved":false,"context_lines":[{"line_number":7934,"context_line":"        (refs, resv_id) \u003d self.compute_api.create(self.context, inst_type,"},{"line_number":7935,"context_line":"                                                  self.fake_image[\u0027id\u0027])"},{"line_number":7936,"context_line":""},{"line_number":7937,"context_line":"        # TODO(avolkov): move this test to functional area"},{"line_number":7938,"context_line":"        # cause bdm is created in conductor method now"},{"line_number":7939,"context_line":""},{"line_number":7940,"context_line":"        # instance_uuid \u003d refs[0][\u0027uuid\u0027]"},{"line_number":7941,"context_line":"        # bdms \u003d block_device_obj.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":7942,"context_line":"        #     self.context, instance_uuid)"},{"line_number":7943,"context_line":""},{"line_number":7944,"context_line":"        # ephemeral \u003d list(filter(block_device.new_format_is_ephemeral, bdms))"},{"line_number":7945,"context_line":"        # self.assertEqual(1, len(ephemeral))"},{"line_number":7946,"context_line":"        # swap \u003d list(filter(block_device.new_format_is_swap, bdms))"},{"line_number":7947,"context_line":"        # self.assertEqual(1, len(swap))"},{"line_number":7948,"context_line":""},{"line_number":7949,"context_line":"        # self.assertEqual(1024, swap[0].volume_size)"},{"line_number":7950,"context_line":"        # self.assertEqual(1, ephemeral[0].volume_size)"},{"line_number":7951,"context_line":""},{"line_number":7952,"context_line":"    def test_create_with_deleted_image(self):"},{"line_number":7953,"context_line":"        # If we\u0027re given a deleted image by glance, we should not be able to"}],"source_content_type":"text/x-python","patch_set":71,"id":"5a3905b3_c6529112","line":7950,"range":{"start_line":7937,"start_character":6,"end_line":7950,"end_character":55},"in_reply_to":"5a3905b3_5d8135fa","updated":"2017-01-24 16:04:44.000000000","message":"Yep, thanks, forgot about this.","commit_id":"1ffb554a5458abaeec8ae1e88546e0b7040bc4e9"}]}
