)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"03c663853267dab1b403785240ad5d4cd71b1e3e","unresolved":false,"context_lines":[{"line_number":11,"context_line":"yet been scheduled and that list/show requests should be honored using"},{"line_number":12,"context_line":"the persisted RequestSpec/BuildRequest.  That work will be a followup to"},{"line_number":13,"context_line":"this one."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I6f02e966d2cef85f98b4b64aedd8c352387af15d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"fa69d971_c1bdeb02","line":14,"updated":"2016-01-06 17:35:57.000000000","message":"Link to bp cells-scheduling-interaction.","commit_id":"3c286be1c91a85dd08a338d9281c56af0c86c4ca"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"98d18bc48ea30977425ca7cc259f3ed36b0a78cd","unresolved":false,"context_lines":[{"line_number":17,"context_line":"the instance_mapping will be removed. The instance will be mapped later"},{"line_number":18,"context_line":"as part of the migration process to cellsv2."},{"line_number":19,"context_line":""},{"line_number":20,"context_line":"Partially-implements: bp cells-scheduling-interaction"},{"line_number":21,"context_line":"Change-Id: I6f02e966d2cef85f98b4b64aedd8c352387af15d"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"1af94dfe_6911e75c","line":20,"range":{"start_line":20,"start_character":25,"end_line":20,"end_character":53},"updated":"2016-03-18 17:31:24.000000000","message":"add-buildrequest-obj","commit_id":"ee4a564065d943a83683751a31cdec2328e24c2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Populate instance_mappings during boot"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We need to start populating the mappings of instance to cells. For now a"},{"line_number":10,"context_line":"mapping with a null cell_id will indicate that the instance has not yet"},{"line_number":11,"context_line":"been scheduled and that list/show requests should be honored using the"},{"line_number":12,"context_line":"persisted RequestSpec/BuildRequest. That work will be a followup to this"},{"line_number":13,"context_line":"one."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":33,"id":"ba0121b8_89e23e9e","line":10,"range":{"start_line":10,"start_character":20,"end_line":10,"end_character":27},"updated":"2016-03-28 20:47:36.000000000","message":"cell_mapping","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"fbface1b5761d99594b833957672b94524cc5759","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Populate instance_mappings during boot"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"We need to start populating the mappings of instance to cells. For now a"},{"line_number":10,"context_line":"mapping with a null cell_id will indicate that the instance has not yet"},{"line_number":11,"context_line":"been scheduled and that list/show requests should be honored using the"},{"line_number":12,"context_line":"persisted RequestSpec/BuildRequest. That work will be a followup to this"},{"line_number":13,"context_line":"one."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":33,"id":"ba0121b8_a4c48740","line":10,"range":{"start_line":10,"start_character":20,"end_line":10,"end_character":27},"in_reply_to":"ba0121b8_89e23e9e","updated":"2016-03-28 20:56:16.000000000","message":"argh","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"}],"nova/compute/api.py":[{"author":{"_account_id":10327,"name":"Feng Xi Yan","email":"yanfengxi@cn.ibm.com","username":"yanfengxi"},"change_message_id":"d5b7dc99fe2c5fe0841670137f3da13a4ec77ee6","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_b0071217","line":981,"updated":"2016-03-03 06:01:38.000000000","message":"I think this line has conflicts with patch https://review.openstack.org/#/c/286309/.","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4be60e0dad5bcc447dfd0ba61b8b4712f35d1e96","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":25,"id":"fa0719c6_807c1db6","line":981,"updated":"2016-03-24 00:56:18.000000000","message":"How is this not exploding in tests?","commit_id":"27609619f9bff3a80e432477ffeb4d51a1cf4c99"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1193ae7313be17139be5c8d73e809aafb7b37da6","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":25,"id":"da0c15f0_0d0c8193","line":981,"in_reply_to":"da0c15f0_4d4b192c","updated":"2016-03-24 18:23:24.000000000","message":"No, sorry, I mean because InstanceMapping.cell_id is gone from the dependent change, it\u0027s now cell_mapping.","commit_id":"27609619f9bff3a80e432477ffeb4d51a1cf4c99"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"6e4abc413152fe104de9d2861c6f4d2a0f08442c","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":25,"id":"da0c15f0_4d4b192c","line":981,"in_reply_to":"fa0719c6_807c1db6","updated":"2016-03-24 18:14:44.000000000","message":"I\u0027m going to guess that you mean the create() below. It doesn\u0027t explode because the unfortunate reality is that few tests touch this code path. The ones that do, which I recently added :), have had a mock added.","commit_id":"27609619f9bff3a80e432477ffeb4d51a1cf4c99"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"72b05f63b06c0121cad1c7d7c123998537c36f5c","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":26,"id":"da0c15f0_4d8959ca","line":981,"range":{"start_line":981,"start_character":29,"end_line":981,"end_character":36},"updated":"2016-03-24 18:26:45.000000000","message":"This should be cell_mapping, are we testing this?","commit_id":"5a228e9175a21fb81ac28b84020ed4f601c2f222"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"1e65a53b81e49afdc74e8242cb20212ea313ed49","unresolved":false,"context_lines":[{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_id \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"}],"source_content_type":"text/x-python","patch_set":26,"id":"da0c15f0_2d098532","line":981,"range":{"start_line":981,"start_character":29,"end_line":981,"end_character":36},"in_reply_to":"da0c15f0_4d8959ca","updated":"2016-03-24 18:30:39.000000000","message":"The right thing to to here would be to set cell_mapping to None. Functionally it ends up being the same as not setting it. This should be fixed, but it doesn\u0027t actually cause I bug as far as I can see.","commit_id":"5a228e9175a21fb81ac28b84020ed4f601c2f222"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6b0e189db83ee04d69759f2c553d76dc3f8459f3","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_mapping \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"},{"line_number":985,"context_line":"                # has picked a cell/host. Set the instance_mapping to the cell"}],"source_content_type":"text/x-python","patch_set":32,"id":"da0c15f0_58ba8724","line":982,"updated":"2016-03-25 22:08:19.000000000","message":"Is there some reason you want to create the mapping before the instance record? I had thought the instance doesn\u0027t really \"exist\" until the record is created and if for some reason the instance record creation failed we\u0027d have an instance mapping with no instance. Maybe it doesn\u0027t really matter.","commit_id":"d18adc7af291630ac979fa7ad120c9d250c32ac7"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c61e36add59af4596738350a753456e156ca0a72","unresolved":false,"context_lines":[{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"},{"line_number":981,"context_line":"                inst_mapping.cell_mapping \u003d None"},{"line_number":982,"context_line":"                inst_mapping.create()"},{"line_number":983,"context_line":"                # TODO(alaski): Cast to conductor here which will call the"},{"line_number":984,"context_line":"                # scheduler and defer instance creation until the scheduler"},{"line_number":985,"context_line":"                # has picked a cell/host. Set the instance_mapping to the cell"}],"source_content_type":"text/x-python","patch_set":32,"id":"da0c15f0_376fb42c","line":982,"in_reply_to":"da0c15f0_58ba8724","updated":"2016-03-28 11:06:25.000000000","message":"Your reasoning is correct, but this distinction in this case is that the build_request is a substitute for the instance until the instance has been created. So what happens is the BuildRequest is created in the API db, the mapping is created with \u0027cell_mapping \u003d None\u0027 to indicate that it can be found there, the instance is created (and later will be created after scheduling), the instance_mapping is updated to point at the instance, the buildrequest is removed. So at every point the instance_mapping should point at a valid resource.","commit_id":"d18adc7af291630ac979fa7ad120c9d250c32ac7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":970,"context_line":"                build_request \u003d self._create_build_request(context,"},{"line_number":971,"context_line":"                        instance_uuid, base_options, req_spec, security_groups,"},{"line_number":972,"context_line":"                        num_instances, i)"},{"line_number":973,"context_line":"                # Create an instance_mapping.  The null cell_id indicates that"},{"line_number":974,"context_line":"                # the instance doesn\u0027t yet exist in a cell, and lookups for it"},{"line_number":975,"context_line":"                # need to instead look for the RequestSpec.  cell_id will be"},{"line_number":976,"context_line":"                # populated after scheduling, with a scheduling failure using"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_299fb204","line":973,"range":{"start_line":973,"start_character":56,"end_line":973,"end_character":63},"updated":"2016-03-28 20:47:36.000000000","message":"cell_mapping","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":972,"context_line":"                        num_instances, i)"},{"line_number":973,"context_line":"                # Create an instance_mapping.  The null cell_id indicates that"},{"line_number":974,"context_line":"                # the instance doesn\u0027t yet exist in a cell, and lookups for it"},{"line_number":975,"context_line":"                # need to instead look for the RequestSpec.  cell_id will be"},{"line_number":976,"context_line":"                # populated after scheduling, with a scheduling failure using"},{"line_number":977,"context_line":"                # the cell_id for the special cell0."},{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_09a46e55","line":975,"range":{"start_line":975,"start_character":61,"end_line":975,"end_character":68},"updated":"2016-03-28 20:47:36.000000000","message":"cell_mapping\n\nor am I lost because instance_mapping.cell_id is a thing:\n\nhttps://github.com/openstack/nova/blob/cabe2df80494841dab529ac9ff09453035ec650a/nova/db/sqlalchemy/api_models.py#L68\n\nAnd the object does set it on create and update:\n\nhttps://github.com/openstack/nova/blob/cabe2df80494841dab529ac9ff09453035ec650a/nova/objects/instance_mapping.py#L42","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":974,"context_line":"                # the instance doesn\u0027t yet exist in a cell, and lookups for it"},{"line_number":975,"context_line":"                # need to instead look for the RequestSpec.  cell_id will be"},{"line_number":976,"context_line":"                # populated after scheduling, with a scheduling failure using"},{"line_number":977,"context_line":"                # the cell_id for the special cell0."},{"line_number":978,"context_line":"                inst_mapping \u003d objects.InstanceMapping(context\u003dcontext)"},{"line_number":979,"context_line":"                inst_mapping.instance_uuid \u003d instance_uuid"},{"line_number":980,"context_line":"                inst_mapping.project_id \u003d context.project_id"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_498666ba","line":977,"range":{"start_line":977,"start_character":22,"end_line":977,"end_character":29},"updated":"2016-03-28 20:47:36.000000000","message":"cell_mapping","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"}],"nova/conductor/manager.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cc0ac768d80af2fd2d3f4b2041bc87527f1e48a1","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                # NOTE(alaski): If nova-api is up to date this exception should"},{"line_number":420,"context_line":"                # never be hit. But during an upgrade it\u0027s possible that an old"},{"line_number":421,"context_line":"                # nova-api didn\u0027t create an instance_mapping during this boot"},{"line_number":422,"context_line":"                # request."},{"line_number":423,"context_line":"                pass"},{"line_number":424,"context_line":"            else:"},{"line_number":425,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":18,"id":"7af24918_d0580535","line":422,"updated":"2016-03-02 16:57:50.000000000","message":"we could check all API nodes are upgraded, but this seems way easier for now.","commit_id":"57243d27ee22d6ac52d710ed91816d1812163c7f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"efa072fe3a211259e85fb6e197da8e8c867067b7","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":420,"context_line":"                        context, instance.uuid)"},{"line_number":421,"context_line":"            except exception.InstanceMappingNotFound:"},{"line_number":422,"context_line":"                # NOTE(alaski): If nova-api is up to date this exception should"},{"line_number":423,"context_line":"                # never be hit. But during an upgrade it\u0027s possible that an old"},{"line_number":424,"context_line":"                # nova-api didn\u0027t create an instance_mapping during this boot"},{"line_number":425,"context_line":"                # request."},{"line_number":426,"context_line":"                pass"},{"line_number":427,"context_line":"            else:"},{"line_number":428,"context_line":"                try:"},{"line_number":429,"context_line":"                    host_mapping \u003d objects.HostMapping.get_by_host(context,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_3abda6b7","line":426,"range":{"start_line":422,"start_character":16,"end_line":426,"end_character":20},"updated":"2016-03-03 03:20:18.000000000","message":"Should we log something in this case?","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"97be7d4df9e5ccabc9ce621ea4b27e337a286967","unresolved":false,"context_lines":[{"line_number":419,"context_line":"                inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":420,"context_line":"                        context, instance.uuid)"},{"line_number":421,"context_line":"            except exception.InstanceMappingNotFound:"},{"line_number":422,"context_line":"                # NOTE(alaski): If nova-api is up to date this exception should"},{"line_number":423,"context_line":"                # never be hit. But during an upgrade it\u0027s possible that an old"},{"line_number":424,"context_line":"                # nova-api didn\u0027t create an instance_mapping during this boot"},{"line_number":425,"context_line":"                # request."},{"line_number":426,"context_line":"                pass"},{"line_number":427,"context_line":"            else:"},{"line_number":428,"context_line":"                try:"},{"line_number":429,"context_line":"                    host_mapping \u003d objects.HostMapping.get_by_host(context,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_356c8634","line":426,"range":{"start_line":422,"start_character":16,"end_line":426,"end_character":20},"in_reply_to":"7af24918_3abda6b7","updated":"2016-03-03 10:39:18.000000000","message":"maybe debug, but I don\u0027t think we need to worry about this just yet.","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"efa072fe3a211259e85fb6e197da8e8c867067b7","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    host_mapping \u003d objects.HostMapping.get_by_host(context,"},{"line_number":430,"context_line":"                            host[\u0027host\u0027])"},{"line_number":431,"context_line":"                except exception.HostMappingNotFound:"},{"line_number":432,"context_line":"                    # NOTE(alaski): For now this exception means that a"},{"line_number":433,"context_line":"                    # deployment has not migrated to cellsv2 and we should"},{"line_number":434,"context_line":"                    # remove the instance_mapping that has been created."},{"line_number":435,"context_line":"                    # Eventually this will indicate a failure to properly map a"},{"line_number":436,"context_line":"                    # host to a cell and we may want to reschedule."},{"line_number":437,"context_line":"                    inst_mapping.destroy()"},{"line_number":438,"context_line":"                else:"},{"line_number":439,"context_line":"                    inst_mapping.cell_id \u003d host_mapping.cell_mapping.id"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_bac9b65b","line":436,"range":{"start_line":432,"start_character":20,"end_line":436,"end_character":67},"updated":"2016-03-03 03:20:18.000000000","message":"Log a warning?","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"97be7d4df9e5ccabc9ce621ea4b27e337a286967","unresolved":false,"context_lines":[{"line_number":429,"context_line":"                    host_mapping \u003d objects.HostMapping.get_by_host(context,"},{"line_number":430,"context_line":"                            host[\u0027host\u0027])"},{"line_number":431,"context_line":"                except exception.HostMappingNotFound:"},{"line_number":432,"context_line":"                    # NOTE(alaski): For now this exception means that a"},{"line_number":433,"context_line":"                    # deployment has not migrated to cellsv2 and we should"},{"line_number":434,"context_line":"                    # remove the instance_mapping that has been created."},{"line_number":435,"context_line":"                    # Eventually this will indicate a failure to properly map a"},{"line_number":436,"context_line":"                    # host to a cell and we may want to reschedule."},{"line_number":437,"context_line":"                    inst_mapping.destroy()"},{"line_number":438,"context_line":"                else:"},{"line_number":439,"context_line":"                    inst_mapping.cell_id \u003d host_mapping.cell_mapping.id"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_98ef91e8","line":436,"range":{"start_line":432,"start_character":20,"end_line":436,"end_character":67},"in_reply_to":"7af24918_bac9b65b","updated":"2016-03-03 10:39:18.000000000","message":"well, only if we get the nova-manage command to fix this merged.","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":415,"context_line":"            bdms \u003d objects.BlockDeviceMappingList.get_by_instance_uuid("},{"line_number":416,"context_line":"                    context, instance.uuid)"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"            try:"},{"line_number":419,"context_line":"                inst_mapping \u003d objects.InstanceMapping.get_by_instance_uuid("},{"line_number":420,"context_line":"                        context, instance.uuid)"},{"line_number":421,"context_line":"            except exception.InstanceMappingNotFound:"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_0481f34a","line":418,"updated":"2016-03-28 20:47:36.000000000","message":"nit: this method is now nearly 100 LOC, I\u0027m kind of on the fence about moving this bit into a private method, something like _build_instances_update_instance_mapping.\n\nSome people prefer to leave these things in a single monolithic method though unless it needs to be re-used, so I could go either way.","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                # never be hit. But during an upgrade it\u0027s possible that an old"},{"line_number":424,"context_line":"                # nova-api didn\u0027t create an instance_mapping during this boot"},{"line_number":425,"context_line":"                # request."},{"line_number":426,"context_line":"                pass"},{"line_number":427,"context_line":"            else:"},{"line_number":428,"context_line":"                try:"},{"line_number":429,"context_line":"                    host_mapping \u003d objects.HostMapping.get_by_host(context,"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_e425dfae","line":426,"range":{"start_line":426,"start_character":16,"end_line":426,"end_character":20},"updated":"2016-03-28 20:47:36.000000000","message":"I might have asked this before, but log something?","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":436,"context_line":"                    # host to a cell and we may want to reschedule."},{"line_number":437,"context_line":"                    inst_mapping.destroy()"},{"line_number":438,"context_line":"                else:"},{"line_number":439,"context_line":"                    inst_mapping.cell_id \u003d host_mapping.cell_mapping.id"},{"line_number":440,"context_line":"                    inst_mapping.save()"},{"line_number":441,"context_line":"            self.compute_rpcapi.build_and_run_instance(context,"},{"line_number":442,"context_line":"                    instance\u003dinstance, host\u003dhost[\u0027host\u0027], image\u003dimage,"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_e49affc4","line":439,"range":{"start_line":439,"start_character":20,"end_line":439,"end_character":71},"updated":"2016-03-28 20:47:36.000000000","message":"Seems like it would be cleaner if we did:\n\ninst_mapping.cell_mapping \u003d host_mapping.cell_mapping\n\nThat way we\u0027re not digging into the details of what InstanceMapping does with it\u0027s cell_mapping field (which is set the cell_id in the actual DB).\n\nI\u0027d prefer to abstract those parts.","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"efa072fe3a211259e85fb6e197da8e8c867067b7","unresolved":false,"context_lines":[{"line_number":3042,"context_line":""},{"line_number":3043,"context_line":"        do_test()"},{"line_number":3044,"context_line":""},{"line_number":3045,"context_line":"    def test_provision_instances_creates_instance_mapping(self):"},{"line_number":3046,"context_line":"        @mock.patch.object(self.compute_api, \u0027_check_num_instances_quota\u0027)"},{"line_number":3047,"context_line":"        @mock.patch.object(objects.Instance, \u0027create\u0027)"},{"line_number":3048,"context_line":"        @mock.patch.object(self.compute_api.security_group_api,"}],"source_content_type":"text/x-python","patch_set":21,"id":"7af24918_fabfbea7","line":3045,"updated":"2016-03-03 03:20:18.000000000","message":"I\u0027d think you could bake this into one of the existing tests above it since the change is pretty simple.","commit_id":"b7bb0e162e8d83c2d8792792ca2131138ed1f387"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"fc77e329d9a3f05fa4a3e77008609fe7a6c0b41c","unresolved":false,"context_lines":[{"line_number":3191,"context_line":""},{"line_number":3192,"context_line":"            self.assertEqual(instances[0].uuid,"},{"line_number":3193,"context_line":"                    inst_mapping_mock.instance_uuid)"},{"line_number":3194,"context_line":"            self.assertEqual(None, inst_mapping_mock.cell_mapping)"},{"line_number":3195,"context_line":"        do_test()"},{"line_number":3196,"context_line":""},{"line_number":3197,"context_line":"    def _test_rescue(self, vm_state\u003dvm_states.ACTIVE, rescue_password\u003dNone,"}],"source_content_type":"text/x-python","patch_set":27,"id":"da0c15f0_0e41170c","line":3194,"updated":"2016-03-24 19:25:37.000000000","message":"Matt, now testing the None condition here.","commit_id":"86efcfd8ec9fb42fe4485eed2ac7a0f3d9e8138e"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"2c08f56cc0be572695b10c41c663d1be08aa38d9","unresolved":false,"context_lines":[{"line_number":3191,"context_line":""},{"line_number":3192,"context_line":"            self.assertEqual(instances[0].uuid,"},{"line_number":3193,"context_line":"                    inst_mapping_mock.instance_uuid)"},{"line_number":3194,"context_line":"            self.assertEqual(None, inst_mapping_mock.cell_mapping)"},{"line_number":3195,"context_line":"        do_test()"},{"line_number":3196,"context_line":""},{"line_number":3197,"context_line":"    def _test_rescue(self, vm_state\u003dvm_states.ACTIVE, rescue_password\u003dNone,"}],"source_content_type":"text/x-python","patch_set":27,"id":"da0c15f0_bbcb0a1e","line":3194,"in_reply_to":"da0c15f0_0e41170c","updated":"2016-03-24 20:48:43.000000000","message":"bah, pep8 is going to yell at me.","commit_id":"86efcfd8ec9fb42fe4485eed2ac7a0f3d9e8138e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"6b0e189db83ee04d69759f2c553d76dc3f8459f3","unresolved":false,"context_lines":[{"line_number":3136,"context_line":"        @mock.patch.object(objects.RequestSpec, \u0027from_components\u0027)"},{"line_number":3137,"context_line":"        @mock.patch.object(objects, \u0027BuildRequest\u0027)"},{"line_number":3138,"context_line":"        @mock.patch(\u0027nova.objects.InstanceMapping\u0027)"},{"line_number":3139,"context_line":"        def do_test(mock_inst_mapping, _mock_build_req,"},{"line_number":3140,"context_line":"                _mock_req_spec_from_components, _mock_create_bdm,"},{"line_number":3141,"context_line":"                _mock_validate_bdm, _mock_ensure_default, _mock_create,"},{"line_number":3142,"context_line":"                mock_check_num_inst_quota):"},{"line_number":3143,"context_line":"            quota_mock \u003d mock.MagicMock()"},{"line_number":3144,"context_line":"            inst_mapping_mock \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":32,"id":"da0c15f0_98889f24","line":3141,"range":{"start_line":3139,"start_character":39,"end_line":3141,"end_character":71},"updated":"2016-03-25 22:08:19.000000000","message":"I saw on another review that apparently if you specify new\u003dTrue in the patch call, you won\u0027t get an arg passed in by the decorator and can avoid all these.\n\nIn the doc [1] the target is patched with \"new\" and only if \"new\" is omitted (or DEFAULT) then the created mock is passed in as an extra argument to the decorated function.\n\n[1] https://docs.python.org/dev/library/unittest.mock.html#patch","commit_id":"d18adc7af291630ac979fa7ad120c9d250c32ac7"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"c61e36add59af4596738350a753456e156ca0a72","unresolved":false,"context_lines":[{"line_number":3136,"context_line":"        @mock.patch.object(objects.RequestSpec, \u0027from_components\u0027)"},{"line_number":3137,"context_line":"        @mock.patch.object(objects, \u0027BuildRequest\u0027)"},{"line_number":3138,"context_line":"        @mock.patch(\u0027nova.objects.InstanceMapping\u0027)"},{"line_number":3139,"context_line":"        def do_test(mock_inst_mapping, _mock_build_req,"},{"line_number":3140,"context_line":"                _mock_req_spec_from_components, _mock_create_bdm,"},{"line_number":3141,"context_line":"                _mock_validate_bdm, _mock_ensure_default, _mock_create,"},{"line_number":3142,"context_line":"                mock_check_num_inst_quota):"},{"line_number":3143,"context_line":"            quota_mock \u003d mock.MagicMock()"},{"line_number":3144,"context_line":"            inst_mapping_mock \u003d mock.MagicMock()"}],"source_content_type":"text/x-python","patch_set":32,"id":"da0c15f0_b761043c","line":3141,"range":{"start_line":3139,"start_character":39,"end_line":3141,"end_character":71},"in_reply_to":"da0c15f0_98889f24","updated":"2016-03-28 11:06:25.000000000","message":"Cool. I can do that to clean this up.","commit_id":"d18adc7af291630ac979fa7ad120c9d250c32ac7"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":3189,"context_line":"                    filter_properties)"},{"line_number":3190,"context_line":"            self.assertTrue(uuidutils.is_uuid_like(instances[0].uuid))"},{"line_number":3191,"context_line":""},{"line_number":3192,"context_line":"            self.assertEqual(instances[0].uuid,"},{"line_number":3193,"context_line":"                    inst_mapping_mock.instance_uuid)"},{"line_number":3194,"context_line":"            self.assertIsNone(inst_mapping_mock.cell_mapping)"},{"line_number":3195,"context_line":"        do_test()"},{"line_number":3196,"context_line":""},{"line_number":3197,"context_line":"    def _test_rescue(self, vm_state\u003dvm_states.ACTIVE, rescue_password\u003dNone,"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_44480b2e","line":3194,"range":{"start_line":3192,"start_character":12,"end_line":3194,"end_character":61},"updated":"2016-03-28 20:47:36.000000000","message":"nit: check the inst_mapping_mock.project_id is equal to context.project_id?","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"}],"nova/tests/unit/conductor/test_conductor.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":696,"context_line":"                              security_groups\u003d\u0027security_groups\u0027,"},{"line_number":697,"context_line":"                              block_device_mapping\u003d\u0027block_device_mapping\u0027,"},{"line_number":698,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":699,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":700,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":701,"context_line":"            mock.call().destroy(),"},{"line_number":702,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":703,"context_line":"            mock.call().destroy())"},{"line_number":704,"context_line":"        mock_get_by_host.assert_has_calls([mock.call(self.context, \u0027host1\u0027),"},{"line_number":705,"context_line":"                                           mock.call(self.context, \u0027host2\u0027)])"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_64954f3f","line":703,"range":{"start_line":699,"start_character":8,"end_line":703,"end_character":34},"updated":"2016-03-28 20:47:36.000000000","message":"This reads very weird to me, like the list looks like it\u0027s only the first 3 calls. I think it\u0027s basically asserting that InstanceMapping.get_by_instance_uuid is called twice per uuid and destroy() is called on each resulting InstanceMapping object. But we don\u0027t call destroy() on InstanceMapping.get_by_instance_uuid, we call it on the resulting mock object that it returns.","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a248b30cc85c58a56c453d7aecbce3e39e113632","unresolved":false,"context_lines":[{"line_number":696,"context_line":"                              security_groups\u003d\u0027security_groups\u0027,"},{"line_number":697,"context_line":"                              block_device_mapping\u003d\u0027block_device_mapping\u0027,"},{"line_number":698,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":699,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":700,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":701,"context_line":"            mock.call().destroy(),"},{"line_number":702,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":703,"context_line":"            mock.call().destroy())"},{"line_number":704,"context_line":"        mock_get_by_host.assert_has_calls([mock.call(self.context, \u0027host1\u0027),"},{"line_number":705,"context_line":"                                           mock.call(self.context, \u0027host2\u0027)])"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_0a045d7c","line":703,"range":{"start_line":699,"start_character":8,"end_line":703,"end_character":34},"in_reply_to":"ba0121b8_645eef46","updated":"2016-03-28 21:15:32.000000000","message":"Try something like this, it\u0027s cleaner IMO, and passed my local hack job of the code:\n\nhttp://paste.openstack.org/show/492164/","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a824f52f7d71ab39597fe636b5733214b3ee5ced","unresolved":false,"context_lines":[{"line_number":696,"context_line":"                              security_groups\u003d\u0027security_groups\u0027,"},{"line_number":697,"context_line":"                              block_device_mapping\u003d\u0027block_device_mapping\u0027,"},{"line_number":698,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":699,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":700,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":701,"context_line":"            mock.call().destroy(),"},{"line_number":702,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":703,"context_line":"            mock.call().destroy())"},{"line_number":704,"context_line":"        mock_get_by_host.assert_has_calls([mock.call(self.context, \u0027host1\u0027),"},{"line_number":705,"context_line":"                                           mock.call(self.context, \u0027host2\u0027)])"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_645eef46","line":703,"range":{"start_line":699,"start_character":8,"end_line":703,"end_character":34},"in_reply_to":"ba0121b8_64954f3f","updated":"2016-03-28 20:59:14.000000000","message":"I pulled this down and messed with the code, and this passes the tests:\n\nhttp://paste.openstack.org/show/492161/\n\nSo maybe you should do something like have mock_get_inst_map_by_uuid.side_effect \u003d (inst_mapping1, instance_mapping2) where those are mocks, and you assert mock_get_inst_map_by_uuid is called twice (with the multiple uuids), and then that the instance mapping mocks are each called with destroy() once (or return the same mock instance_mapping both times and assert destroy() is called twice on it).","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"fbface1b5761d99594b833957672b94524cc5759","unresolved":false,"context_lines":[{"line_number":696,"context_line":"                              security_groups\u003d\u0027security_groups\u0027,"},{"line_number":697,"context_line":"                              block_device_mapping\u003d\u0027block_device_mapping\u0027,"},{"line_number":698,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":699,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":700,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":701,"context_line":"            mock.call().destroy(),"},{"line_number":702,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":703,"context_line":"            mock.call().destroy())"},{"line_number":704,"context_line":"        mock_get_by_host.assert_has_calls([mock.call(self.context, \u0027host1\u0027),"},{"line_number":705,"context_line":"                                           mock.call(self.context, \u0027host2\u0027)])"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_04d613c5","line":703,"range":{"start_line":699,"start_character":8,"end_line":703,"end_character":34},"in_reply_to":"ba0121b8_64954f3f","updated":"2016-03-28 20:56:16.000000000","message":"It\u0027s called once per uuid, but mock.call() seems to be the mock object that\u0027s returned.","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c0ecc55f872bf39f99d9c5feedf9d5847791e7c0","unresolved":false,"context_lines":[{"line_number":746,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":747,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":748,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":749,"context_line":"            mock.call().save(),"},{"line_number":750,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":751,"context_line":"            mock.call().save())"},{"line_number":752,"context_line":"        self.assertEqual(2, inst_mapping_mock.cell_id)"}],"source_content_type":"text/x-python","patch_set":33,"id":"ba0121b8_c4937b4e","line":749,"range":{"start_line":749,"start_character":12,"end_line":749,"end_character":30},"updated":"2016-03-28 20:47:36.000000000","message":"Seems this should be:\n\ninst_mapping_mock.assert_has_calls([mock.call().save(), mock.call().save()])","commit_id":"a39c01133c313685e41307ecf6a4d8700292dead"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce3047eb8c7aa48dfa3e8813fa61ffaa7dfa4c45","unresolved":false,"context_lines":[{"line_number":748,"context_line":"                              security_groups\u003d\u0027security_groups\u0027,"},{"line_number":749,"context_line":"                              block_device_mapping\u003d\u0027block_device_mapping\u0027,"},{"line_number":750,"context_line":"                              legacy_bdm\u003dFalse)"},{"line_number":751,"context_line":"        mock_get_inst_map_by_uuid.assert_has_calls(["},{"line_number":752,"context_line":"            mock.call(self.context, instances[0].uuid),"},{"line_number":753,"context_line":"            mock.call().save(),"},{"line_number":754,"context_line":"            mock.call(self.context, instances[1].uuid)],"},{"line_number":755,"context_line":"            mock.call().save())"},{"line_number":756,"context_line":"        self.assertEqual(2, inst_mapping_mock.cell_id)"},{"line_number":757,"context_line":"        mock_get_by_host.assert_has_calls([mock.call(self.context, \u0027host1\u0027),"},{"line_number":758,"context_line":"                                           mock.call(self.context, \u0027host2\u0027)])"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba0121b8_2d3a1b37","line":755,"range":{"start_line":751,"start_character":8,"end_line":755,"end_character":31},"updated":"2016-03-28 21:42:35.000000000","message":"Can we clean this up too like you did above?","commit_id":"afa6fef5455adfffc09f89a5c56fc7e80ebb432b"}]}
