)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Teach HostAPI about cells"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This makes the HostAPI module know enough about cells to support"},{"line_number":10,"context_line":"the os-hypervisors API module."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Related to blueprint cells-aware-api"},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"bff0334d_72f9cb7e","line":10,"updated":"2017-04-06 01:02:51.000000000","message":"And os-services (and os-hypervisors and os-evacuate, you\u0027ll see).\n\nAlso seems like you should give some more information here about the multi-cell case where we can\u0027t find a unique compute node / service by id and fail, which will be fixed later in another microversion using blueprint service-hyper-uuid-in-api.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"}],"nova/api/openstack/compute/hosts.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        else:"},{"line_number":165,"context_line":"            LOG.info(_LI(\"Disabling host %s.\"), host_name)"},{"line_number":166,"context_line":"        try:"},{"line_number":167,"context_line":"            result \u003d self.api.set_host_enabled(context, host_name, enabled)"},{"line_number":168,"context_line":"        except NotImplementedError:"},{"line_number":169,"context_line":"            common.raise_feature_not_supported()"},{"line_number":170,"context_line":"        except (exception.HostNotFound, exception.HostMappingNotFound) as e:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_e0862412","line":167,"updated":"2017-03-08 20:26:28.000000000","message":"Why did the kwargs need to be removed from this? The target_host_cell decorator shouldn\u0027t make a difference.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a6fb7db7d4acf04dd66bda1397edf79510175ea6","unresolved":false,"context_lines":[{"line_number":164,"context_line":"        else:"},{"line_number":165,"context_line":"            LOG.info(_LI(\"Disabling host %s.\"), host_name)"},{"line_number":166,"context_line":"        try:"},{"line_number":167,"context_line":"            result \u003d self.api.set_host_enabled(context, host_name, enabled)"},{"line_number":168,"context_line":"        except NotImplementedError:"},{"line_number":169,"context_line":"            common.raise_feature_not_supported()"},{"line_number":170,"context_line":"        except (exception.HostNotFound, exception.HostMappingNotFound) as e:"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_7403d50d","line":167,"in_reply_to":"9a30ddce_e0862412","updated":"2017-03-08 20:30:40.000000000","message":"Well, for one, these are kwargs. But yeah, the decorator cares. See the comment in the next file.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        except (exception.ComputeHostNotFound,"},{"line_number":273,"context_line":"                exception.HostMappingNotFound) as e:"},{"line_number":274,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":275,"context_line":"        instances \u003d self.api.instance_get_all_by_host(context, host_name)"},{"line_number":276,"context_line":"        resources \u003d [self._get_total_resources(host_name, compute_node)]"},{"line_number":277,"context_line":"        resources.append(self._get_used_now_resources(host_name,"},{"line_number":278,"context_line":"                                                      compute_node))"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_4dc86c54","line":275,"range":{"start_line":275,"start_character":29,"end_line":275,"end_character":53},"updated":"2017-04-06 01:02:51.000000000","message":"Need to handle HostMappingNotFound.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"af7a7c9adc4a1281e92f03c585fb8c7f5d28a962","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        except (exception.ComputeHostNotFound,"},{"line_number":273,"context_line":"                exception.HostMappingNotFound) as e:"},{"line_number":274,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":275,"context_line":"        instances \u003d self.api.instance_get_all_by_host(context, host_name)"},{"line_number":276,"context_line":"        resources \u003d [self._get_total_resources(host_name, compute_node)]"},{"line_number":277,"context_line":"        resources.append(self._get_used_now_resources(host_name,"},{"line_number":278,"context_line":"                                                      compute_node))"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_44ddc512","line":275,"range":{"start_line":275,"start_character":29,"end_line":275,"end_character":53},"in_reply_to":"bff0334d_2e7e22e4","updated":"2017-04-06 16:55:19.000000000","message":"Oh yeah good point.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cb612e0d770c20628ce0a8410bfff699dfbca8bc","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        except (exception.ComputeHostNotFound,"},{"line_number":273,"context_line":"                exception.HostMappingNotFound) as e:"},{"line_number":274,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":275,"context_line":"        instances \u003d self.api.instance_get_all_by_host(context, host_name)"},{"line_number":276,"context_line":"        resources \u003d [self._get_total_resources(host_name, compute_node)]"},{"line_number":277,"context_line":"        resources.append(self._get_used_now_resources(host_name,"},{"line_number":278,"context_line":"                                                      compute_node))"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_2e7e22e4","line":275,"range":{"start_line":275,"start_character":29,"end_line":275,"end_character":53},"in_reply_to":"bff0334d_4dc86c54","updated":"2017-04-06 16:18:57.000000000","message":"We shouldn\u0027t get here if it\u0027s not found ecause of L267, but I\u0027ll paper over that so we don\u0027t 500.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"66d29d3db12c9d07ebb7928c719b84881bae6a5c","unresolved":false,"context_lines":[{"line_number":275,"context_line":"        try:"},{"line_number":276,"context_line":"            instances \u003d self.api.instance_get_all_by_host(context, host_name)"},{"line_number":277,"context_line":"        except exception.HostMappingNotFound:"},{"line_number":278,"context_line":"            instances \u003d []"},{"line_number":279,"context_line":"        resources \u003d [self._get_total_resources(host_name, compute_node)]"},{"line_number":280,"context_line":"        resources.append(self._get_used_now_resources(host_name,"},{"line_number":281,"context_line":"                                                      compute_node))"}],"source_content_type":"text/x-python","patch_set":20,"id":"bff0334d_e4bcd96a","line":278,"range":{"start_line":278,"start_character":12,"end_line":278,"end_character":26},"updated":"2017-04-06 17:08:20.000000000","message":"Why not raise up the 404?\n\nraise webob.exc.HTTPNotFound(explanation\u003de.format_message())\n\nWe could just move this call up into the try/except block above.","commit_id":"0da44cc6dac1009eb28e9e87a6aea8938d9e287e"}],"nova/api/openstack/compute/hypervisors.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"66d29d3db12c9d07ebb7928c719b84881bae6a5c","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                service \u003d self.host_api.service_get_by_compute_host("},{"line_number":254,"context_line":"                    context, compute_node.host)"},{"line_number":255,"context_line":"            except exception.HostMappingNotFound:"},{"line_number":256,"context_line":"                msg \u003d _(\"No hypervisor matching \u0027%s\u0027 could be found.\") % id"},{"line_number":257,"context_line":"                raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":258,"context_line":"            hyp \u003d self._view_hypervisor(compute_node, service, False, req,"},{"line_number":259,"context_line":"                                        instances)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bff0334d_3fd2ca5d","line":256,"range":{"start_line":256,"start_character":73,"end_line":256,"end_character":75},"updated":"2017-04-06 17:08:20.000000000","message":"This should be compute_node.host.","commit_id":"0da44cc6dac1009eb28e9e87a6aea8938d9e287e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7f5fa6e71e2d51b306d57356f38bd2771832e881","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                service \u003d self.host_api.service_get_by_compute_host("},{"line_number":254,"context_line":"                    context, compute_node.host)"},{"line_number":255,"context_line":"            except exception.HostMappingNotFound:"},{"line_number":256,"context_line":"                msg \u003d _(\"No hypervisor matching \u0027%s\u0027 could be found.\") % id"},{"line_number":257,"context_line":"                raise webob.exc.HTTPNotFound(explanation\u003dmsg)"},{"line_number":258,"context_line":"            hyp \u003d self._view_hypervisor(compute_node, service, False, req,"},{"line_number":259,"context_line":"                                        instances)"}],"source_content_type":"text/x-python","patch_set":20,"id":"bff0334d_9f47961e","line":256,"range":{"start_line":256,"start_character":73,"end_line":256,"end_character":75},"in_reply_to":"bff0334d_3fd2ca5d","updated":"2017-04-06 17:09:42.000000000","message":"Actually this would probably make more sense to just do:\n\nexplanation\u003de.format_message()","commit_id":"0da44cc6dac1009eb28e9e87a6aea8938d9e287e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6ed9f50cc54c763339dbd6a60275b62341b95aeb","unresolved":false,"context_lines":[{"line_number":253,"context_line":"                service \u003d self.host_api.service_get_by_compute_host("},{"line_number":254,"context_line":"                    context, compute_node.host)"},{"line_number":255,"context_line":"            except exception.HostMappingNotFound as e:"},{"line_number":256,"context_line":"                raise webob.exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":257,"context_line":"            hyp \u003d self._view_hypervisor(compute_node, service, False, req,"},{"line_number":258,"context_line":"                                        instances)"},{"line_number":259,"context_line":"            hypervisors.append(hyp)"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_9a21e4b7","line":256,"updated":"2017-04-06 17:56:31.000000000","message":"I almost wonder if we should skip these ones that aren\u0027t found so we can at least return something, but if it\u0027s the only one then it\u0027s correct to return. But failing is probably good.","commit_id":"74c5bfea6f9616690bc9937d1f32cb4a647b6cdd"}],"nova/api/openstack/compute/services.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":150,"context_line":"    def _update(self, context, host, binary, payload):"},{"line_number":151,"context_line":"        \"\"\"Do the actual PUT/update\"\"\""},{"line_number":152,"context_line":"        try:"},{"line_number":153,"context_line":"            self.host_api.service_update(context, host, binary, payload)"},{"line_number":154,"context_line":"        except exception.HostBinaryNotFound as exc:"},{"line_number":155,"context_line":"            raise webob.exc.HTTPNotFound(explanation\u003dexc.format_message())"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_0da9447a","line":153,"updated":"2017-04-06 01:02:51.000000000","message":"Need to handle HostMappingNotFound.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    global CELLS"},{"line_number":202,"context_line":"    if not CELLS:"},{"line_number":203,"context_line":"        CELLS \u003d objects.CellMappingList.get_all("},{"line_number":204,"context_line":"            nova_context.get_admin_context())"},{"line_number":205,"context_line":"        LOG.debug(\u0027Found %(count)i cells: %(cells)s\u0027,"},{"line_number":206,"context_line":"                  dict(count\u003dlen(CELLS), cells\u003dCELLS))"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_60aa3472","line":204,"range":{"start_line":204,"start_character":12,"end_line":204,"end_character":44},"updated":"2017-03-08 20:26:28.000000000","message":"I suppose this doesn\u0027t matter, but you could have just passed the context in from the calling function.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"17d4d2fa602fc8c0f4cf67b90eb1c22d3f32fa2a","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    global CELLS"},{"line_number":202,"context_line":"    if not CELLS:"},{"line_number":203,"context_line":"        CELLS \u003d objects.CellMappingList.get_all("},{"line_number":204,"context_line":"            nova_context.get_admin_context())"},{"line_number":205,"context_line":"        LOG.debug(\u0027Found %(count)i cells: %(cells)s\u0027,"},{"line_number":206,"context_line":"                  dict(count\u003dlen(CELLS), cells\u003dCELLS))"},{"line_number":207,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_740915dd","line":204,"range":{"start_line":204,"start_character":12,"end_line":204,"end_character":44},"in_reply_to":"9a30ddce_60aa3472","updated":"2017-03-08 20:51:58.000000000","message":"I could, but this is bootstrapping and so it seemed more appropriate here, especially since we\u0027re pulling a purely internal data model.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                  dict(count\u003dlen(CELLS), cells\u003dCELLS))"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    if not CELLS:"},{"line_number":209,"context_line":"        LOG.error(_LE(\u0027No cells are configured, unable to list instances\u0027))"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"@profiler.trace_cls(\"compute_api\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_60c1542e","line":209,"range":{"start_line":209,"start_character":48,"end_line":209,"end_character":72},"updated":"2017-03-08 20:26:28.000000000","message":"This won\u0027t make sense depending on the operation in some cases.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"13d084b71a8023bd3e8ebb4805e6340eca99a6b5","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                  dict(count\u003dlen(CELLS), cells\u003dCELLS))"},{"line_number":207,"context_line":""},{"line_number":208,"context_line":"    if not CELLS:"},{"line_number":209,"context_line":"        LOG.error(_LE(\u0027No cells are configured, unable to list instances\u0027))"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"@profiler.trace_cls(\"compute_api\")"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_b4a9cde1","line":209,"range":{"start_line":209,"start_character":48,"end_line":209,"end_character":72},"in_reply_to":"9a30ddce_60c1542e","updated":"2017-03-08 20:33:26.000000000","message":"Ah, yeah I suppose so.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4138,"context_line":"        return host_statuses"},{"line_number":4139,"context_line":""},{"line_number":4140,"context_line":""},{"line_number":4141,"context_line":"def target_host_cell(fn):"},{"line_number":4142,"context_line":"    def targeted(self, context, host, *args, **kwargs):"},{"line_number":4143,"context_line":"        mapping \u003d objects.HostMapping.get_by_host(context, host)"},{"line_number":4144,"context_line":"        nova_context.set_target_cell(context, mapping.cell_mapping)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_20cbdc73","line":4141,"updated":"2017-03-08 20:26:28.000000000","message":"Why not functools.wraps?","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a6fb7db7d4acf04dd66bda1397edf79510175ea6","unresolved":false,"context_lines":[{"line_number":4138,"context_line":"        return host_statuses"},{"line_number":4139,"context_line":""},{"line_number":4140,"context_line":""},{"line_number":4141,"context_line":"def target_host_cell(fn):"},{"line_number":4142,"context_line":"    def targeted(self, context, host, *args, **kwargs):"},{"line_number":4143,"context_line":"        mapping \u003d objects.HostMapping.get_by_host(context, host)"},{"line_number":4144,"context_line":"        nova_context.set_target_cell(context, mapping.cell_mapping)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_d43ba1cf","line":4141,"in_reply_to":"9a30ddce_20cbdc73","updated":"2017-03-08 20:30:40.000000000","message":"Forgot.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a6fb7db7d4acf04dd66bda1397edf79510175ea6","unresolved":false,"context_lines":[{"line_number":4139,"context_line":""},{"line_number":4140,"context_line":""},{"line_number":4141,"context_line":"def target_host_cell(fn):"},{"line_number":4142,"context_line":"    def targeted(self, context, host, *args, **kwargs):"},{"line_number":4143,"context_line":"        mapping \u003d objects.HostMapping.get_by_host(context, host)"},{"line_number":4144,"context_line":"        nova_context.set_target_cell(context, mapping.cell_mapping)"},{"line_number":4145,"context_line":"        return fn(self, context, host, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_b4246daf","line":4142,"range":{"start_line":4142,"start_character":32,"end_line":4142,"end_character":36},"updated":"2017-03-08 20:30:40.000000000","message":"It cares right here. It needs host below, but if it\u0027s passed as a kwarg, it\u0027ll be in kwargs.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4659a78d11c58c41068450cdb5c5f435f70a6c5c","unresolved":false,"context_lines":[{"line_number":4139,"context_line":""},{"line_number":4140,"context_line":""},{"line_number":4141,"context_line":"def target_host_cell(fn):"},{"line_number":4142,"context_line":"    def targeted(self, context, host, *args, **kwargs):"},{"line_number":4143,"context_line":"        mapping \u003d objects.HostMapping.get_by_host(context, host)"},{"line_number":4144,"context_line":"        nova_context.set_target_cell(context, mapping.cell_mapping)"},{"line_number":4145,"context_line":"        return fn(self, context, host, *args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_1492999e","line":4142,"range":{"start_line":4142,"start_character":32,"end_line":4142,"end_character":36},"in_reply_to":"9a30ddce_b4246daf","updated":"2017-03-08 20:35:08.000000000","message":"OK. FWIW, we have a utility that can pull kwargs out of the args/kwargs list based on argument name that\u0027s used in the compute manager decorators.\n\nLike this:\n\nhttps://github.com/openstack/nova/blob/master/nova/compute/manager.py#L168\n\nI\u0027m fine with just not allowing kwarg for host_name but would probably be good to have a docstring on the decorator for usage since I missed it.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4255,"context_line":"        load_cells()"},{"line_number":4256,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4257,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_a0642c49","line":4258,"updated":"2017-03-08 20:26:28.000000000","message":"you could ignore cell0 in this list like you do in compute_node_get","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4659a78d11c58c41068450cdb5c5f435f70a6c5c","unresolved":false,"context_lines":[{"line_number":4255,"context_line":"        load_cells()"},{"line_number":4256,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4257,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_d4de416c","line":4258,"in_reply_to":"9a30ddce_34315ded","updated":"2017-03-08 20:35:08.000000000","message":"OK, would be good to leave a comment for that.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a6fb7db7d4acf04dd66bda1397edf79510175ea6","unresolved":false,"context_lines":[{"line_number":4255,"context_line":"        load_cells()"},{"line_number":4256,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4257,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_34315ded","line":4258,"in_reply_to":"9a30ddce_a0642c49","updated":"2017-03-08 20:30:40.000000000","message":"Actually not, because nova-api, nova-scheduler, and nova-conductor (super) will register their services in cell0.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"},{"line_number":4262,"context_line":"            return objects.Service.get_by_id(context, service_id)"},{"line_number":4263,"context_line":""},{"line_number":4264,"context_line":"    def service_get_by_id(self, context, service_id):"},{"line_number":4265,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_a07d0ce9","line":4262,"range":{"start_line":4261,"start_character":12,"end_line":4262,"end_character":65},"updated":"2017-03-08 20:26:28.000000000","message":"I\u0027m confused, why not use the decorator form to temporarily mutate the context with the cell mapping? You\u0027re iterating over a list of cell mappings here, and the service you\u0027re looking for might not be in the first cell, it might be in the 3rd, so Service.get_by_id is going to raise ServiceNotFound, right? Don\u0027t you need to keep iterating until you find it or raise ServiceNotFound at the end if it\u0027s not in any cell?","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"677affdd65fa0e648290ab6983a75d19a2742944","unresolved":false,"context_lines":[{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"},{"line_number":4262,"context_line":"            return objects.Service.get_by_id(context, service_id)"},{"line_number":4263,"context_line":""},{"line_number":4264,"context_line":"    def service_get_by_id(self, context, service_id):"},{"line_number":4265,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_14f379d7","line":4262,"range":{"start_line":4261,"start_character":12,"end_line":4262,"end_character":65},"in_reply_to":"9a30ddce_947da970","updated":"2017-03-08 20:42:00.000000000","message":"As noted in IRC, this is going to be bad because we\u0027ve leaked a non-unique ID out of the API.\n\nSo if I have 2 nova-compute services in 2 cells and I want to delete the service with id\u003d2 in cell2, this is going to delete the 2nd service in the first cell.\n\nI\u0027m not sure what we do here unless we change the id returned from the API to be a uuid rather than id, which would be a microversion...","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"13d084b71a8023bd3e8ebb4805e6340eca99a6b5","unresolved":false,"context_lines":[{"line_number":4258,"context_line":"        for cell in CELLS:"},{"line_number":4259,"context_line":"            # NOTE(danms): Set the cell on the context so it remains"},{"line_number":4260,"context_line":"            # when we return to our caller"},{"line_number":4261,"context_line":"            nova_context.set_target_cell(context, cell)"},{"line_number":4262,"context_line":"            return objects.Service.get_by_id(context, service_id)"},{"line_number":4263,"context_line":""},{"line_number":4264,"context_line":"    def service_get_by_id(self, context, service_id):"},{"line_number":4265,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_947da970","line":4262,"range":{"start_line":4261,"start_character":12,"end_line":4262,"end_character":65},"in_reply_to":"9a30ddce_a07d0ce9","updated":"2017-03-08 20:33:26.000000000","message":"So yeah, this hard return might be a mind-o. We definitely need to hard-target the context because this is called to find the service for the host, which means our caller needs to have their context targeted, just like we hard-target in instance get.\n\nHowever, the early return is probably wrong and the ordering of the tests didn\u0027t catch it.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f27d096cf1ecbb3568e8c88d930fe36df26081a9","unresolved":false,"context_lines":[{"line_number":4323,"context_line":"                continue"},{"line_number":4324,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4325,"context_line":"                try:"},{"line_number":4326,"context_line":"                    return objects.ComputeNode.get_by_id(context,"},{"line_number":4327,"context_line":"                                                         int(compute_id))"},{"line_number":4328,"context_line":"                except exception.ComputeHostNotFound:"},{"line_number":4329,"context_line":"                    continue"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_14dd390e","line":4326,"updated":"2017-03-08 20:50:24.000000000","message":"We are going to have the same problem in here as noted in _find_service above, because of the hypervisor show and uptime APIs which take the compute node id.\n\nThe os-pci API also gets all compute nodes for all cells and then gets all pci devices for all compute nodes and lists the ids for all of those out of the API:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/pci.py","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4318,"context_line":""},{"line_number":4319,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4320,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4321,"context_line":"        for cell in CELLS:"},{"line_number":4322,"context_line":"            if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":4323,"context_line":"                continue"},{"line_number":4324,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4325,"context_line":"                try:"},{"line_number":4326,"context_line":"                    return objects.ComputeNode.get_by_id(context,"},{"line_number":4327,"context_line":"                                                         int(compute_id))"},{"line_number":4328,"context_line":"                except exception.ComputeHostNotFound:"},{"line_number":4329,"context_line":"                    continue"},{"line_number":4330,"context_line":""},{"line_number":4331,"context_line":"        raise exception.ComputeHostNotFound(host\u003dcompute_id)"},{"line_number":4332,"context_line":""},{"line_number":4333,"context_line":"    def compute_node_get_all(self, context, limit\u003dNone, marker\u003dNone):"},{"line_number":4334,"context_line":"        load_cells()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_80ef2886","line":4331,"range":{"start_line":4321,"start_character":0,"end_line":4331,"end_character":60},"updated":"2017-03-08 20:26:28.000000000","message":"This is exactly the kind of model I expected to see in _find_service above.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a6fb7db7d4acf04dd66bda1397edf79510175ea6","unresolved":false,"context_lines":[{"line_number":4318,"context_line":""},{"line_number":4319,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4320,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4321,"context_line":"        for cell in CELLS:"},{"line_number":4322,"context_line":"            if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":4323,"context_line":"                continue"},{"line_number":4324,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4325,"context_line":"                try:"},{"line_number":4326,"context_line":"                    return objects.ComputeNode.get_by_id(context,"},{"line_number":4327,"context_line":"                                                         int(compute_id))"},{"line_number":4328,"context_line":"                except exception.ComputeHostNotFound:"},{"line_number":4329,"context_line":"                    continue"},{"line_number":4330,"context_line":""},{"line_number":4331,"context_line":"        raise exception.ComputeHostNotFound(host\u003dcompute_id)"},{"line_number":4332,"context_line":""},{"line_number":4333,"context_line":"    def compute_node_get_all(self, context, limit\u003dNone, marker\u003dNone):"},{"line_number":4334,"context_line":"        load_cells()"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_94584934","line":4331,"range":{"start_line":4321,"start_character":0,"end_line":4331,"end_character":60},"in_reply_to":"9a30ddce_80ef2886","updated":"2017-03-08 20:30:40.000000000","message":"Services can be in cell0, compute nodes cannot :)","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4339,"context_line":"                continue"},{"line_number":4340,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4341,"context_line":"                try:"},{"line_number":4342,"context_line":"                    cell_computes \u003d objects.ComputeNodeList.get_by_pagination("},{"line_number":4343,"context_line":"                        context, limit\u003dlimit, marker\u003dmarker)"},{"line_number":4344,"context_line":"                except exception.MarkerNotFound:"},{"line_number":4345,"context_line":"                    # NOTE(danms): Keep looking through cells"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_c06e8000","line":4342,"range":{"start_line":4342,"start_character":60,"end_line":4342,"end_character":77},"updated":"2017-03-08 20:26:28.000000000","message":"Just a note to self, this sorts by compute_nodes.id in ascending order. Just bringing this up because of the sorting discussion in the simple tenant usage patch. We didn\u0027t change anything there, so assume we don\u0027t need to change anything here. Sorting the entire resulting list across all cells by id ascending wouldn\u0027t work anyway since you\u0027d have duplicates.\n\nThis is going to be kind of messed up for the marker though...what if our limit is 10 and we have 5 computes in 2 cells and our marker is 3, won\u0027t we hit the marker in the first cell every time and fail at paging?\n\nIn other words, doesn\u0027t the marker need to become cell-aware?","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4355,"context_line":""},{"line_number":4356,"context_line":"        if marker is not None and len(computes) \u003d\u003d 0:"},{"line_number":4357,"context_line":"            # NOTE(danms): If we did not find the marker in any cell,"},{"line_number":4358,"context_line":"            # mimic the d_api behavior here."},{"line_number":4359,"context_line":"            raise exception.MarkerNotFound(marker\u003dmarker)"},{"line_number":4360,"context_line":""},{"line_number":4361,"context_line":"        return objects.ComputeNodeList(objects\u003dcomputes)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_409530dc","line":4358,"range":{"start_line":4358,"start_character":24,"end_line":4358,"end_character":29},"updated":"2017-03-08 20:26:28.000000000","message":"nit: DB API","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"088377c46049fd8c71e2f28032b8a6487ff0c515","unresolved":false,"context_lines":[{"line_number":4368,"context_line":"            if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":4369,"context_line":"                continue"},{"line_number":4370,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4371,"context_line":"                cell_computes \u003d objects.ComputeNodeList.get_by_hypervisor("},{"line_number":4372,"context_line":"                    context, hypervisor_match)"},{"line_number":4373,"context_line":"            computes.extend(cell_computes)"},{"line_number":4374,"context_line":"        return objects.ComputeNodeList(objects\u003dcomputes)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_e03f04d4","line":4371,"range":{"start_line":4371,"start_character":56,"end_line":4371,"end_character":73},"updated":"2017-03-08 20:26:28.000000000","message":"note to self, this doesn\u0027t raise an exception if it doesn\u0027t find anything.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16fcc3feed645729322caf78f4d3f72d55529b24","unresolved":false,"context_lines":[{"line_number":4313,"context_line":"            set_zones \u003d True"},{"line_number":4314,"context_line":""},{"line_number":4315,"context_line":"        if all_cells:"},{"line_number":4316,"context_line":"            load_cells()"},{"line_number":4317,"context_line":"            services \u003d []"},{"line_number":4318,"context_line":"            for cell in CELLS:"},{"line_number":4319,"context_line":"                with nova_context.target_cell(context, cell):"}],"source_content_type":"text/x-python","patch_set":11,"id":"7a25e98e_578633ba","line":4316,"range":{"start_line":4316,"start_character":12,"end_line":4316,"end_character":24},"updated":"2017-03-14 00:41:40.000000000","message":"You\u0027re doing this above.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"41963178f968478eb7c0202d01ac65201b75eeab","unresolved":false,"context_lines":[{"line_number":4313,"context_line":"            set_zones \u003d True"},{"line_number":4314,"context_line":""},{"line_number":4315,"context_line":"        if all_cells:"},{"line_number":4316,"context_line":"            load_cells()"},{"line_number":4317,"context_line":"            services \u003d []"},{"line_number":4318,"context_line":"            for cell in CELLS:"},{"line_number":4319,"context_line":"                with nova_context.target_cell(context, cell):"}],"source_content_type":"text/x-python","patch_set":11,"id":"1a1ced50_a6be68d2","line":4316,"range":{"start_line":4316,"start_character":12,"end_line":4316,"end_character":24},"in_reply_to":"7a25e98e_578633ba","updated":"2017-03-16 16:44:05.000000000","message":"Yeah, this is a merge conflict from moving something to earlier in the set.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"16fcc3feed645729322caf78f4d3f72d55529b24","unresolved":false,"context_lines":[{"line_number":4350,"context_line":""},{"line_number":4351,"context_line":"        raise exception.ServiceNotFound(service_id\u003dservice_id)"},{"line_number":4352,"context_line":""},{"line_number":4353,"context_line":"    def service_get_by_id(self, context, service_id):"},{"line_number":4354,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""},{"line_number":4355,"context_line":"        return self._find_service(context, service_id)"},{"line_number":4356,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a25e98e_77588f57","line":4353,"range":{"start_line":4353,"start_character":8,"end_line":4353,"end_character":25},"updated":"2017-03-14 00:41:40.000000000","message":"This is called by DELETE /os-hypervisers and I thought we were holding off on how we were going to do this, i.e. _find_service could return the service you don\u0027t actually want to delete if you have multiple cells and the id of the service you want to delete is 3, but you want to delete service with id\u003d3 in cell 2 but _find_service is going to return the service with id\u003d3 in cell 1.\n\nAs discussed in:\n\nhttps://blueprints.launchpad.net/nova/+spec/service-hyper-pci-uuid-in-api\n\nI thought we were going to scan the cells looking for entries by id, and if there are 0, we raise 404, if there is 1 we proceed, but if there are multiple (conflicts) it\u0027s a 400 or 409 and you have to make the request with a uuid and a microversion for the specific service you want to delete.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d1cc1d87d411c4e5098633ec555984cce82b637e","unresolved":false,"context_lines":[{"line_number":4350,"context_line":""},{"line_number":4351,"context_line":"        raise exception.ServiceNotFound(service_id\u003dservice_id)"},{"line_number":4352,"context_line":""},{"line_number":4353,"context_line":"    def service_get_by_id(self, context, service_id):"},{"line_number":4354,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""},{"line_number":4355,"context_line":"        return self._find_service(context, service_id)"},{"line_number":4356,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"3a1ff146_5a2c6c4a","line":4353,"range":{"start_line":4353,"start_character":8,"end_line":4353,"end_character":25},"in_reply_to":"7a25e98e_77588f57","updated":"2017-03-15 16:30:27.000000000","message":"We are, I pushed this to later in the set and have been working through other things first.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181c26ded8392417eeca49a91b1aa4d897fecbbf","unresolved":false,"context_lines":[{"line_number":4355,"context_line":"        return self._find_service(context, service_id)"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"    @target_host_cell"},{"line_number":4358,"context_line":"    def service_get_by_compute_host(self, context, host_name):"},{"line_number":4359,"context_line":"        \"\"\"Get service entry for the given compute hostname.\"\"\""},{"line_number":4360,"context_line":"        return objects.Service.get_by_compute_host(context, host_name)"},{"line_number":4361,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a25e98e_3241c53a","line":4358,"range":{"start_line":4358,"start_character":8,"end_line":4358,"end_character":35},"updated":"2017-05-15 15:27:13.000000000","message":"This doesn\u0027t search in all cells because we assume the host_name is unique within the deployment? I\u0027m OK if so, but just checking.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fe89a97d399fe1469b43a0e851a2f94ece3b8da3","unresolved":false,"context_lines":[{"line_number":4355,"context_line":"        return self._find_service(context, service_id)"},{"line_number":4356,"context_line":""},{"line_number":4357,"context_line":"    @target_host_cell"},{"line_number":4358,"context_line":"    def service_get_by_compute_host(self, context, host_name):"},{"line_number":4359,"context_line":"        \"\"\"Get service entry for the given compute hostname.\"\"\""},{"line_number":4360,"context_line":"        return objects.Service.get_by_compute_host(context, host_name)"},{"line_number":4361,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1f013ff3_f36cb409","line":4358,"range":{"start_line":4358,"start_character":8,"end_line":4358,"end_character":35},"in_reply_to":"7a25e98e_3241c53a","updated":"2017-05-15 16:09:55.000000000","message":"IMHO, yeah.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"181c26ded8392417eeca49a91b1aa4d897fecbbf","unresolved":false,"context_lines":[{"line_number":4401,"context_line":"                                        host\u003dhost,"},{"line_number":4402,"context_line":"                                        state\u003dstate)"},{"line_number":4403,"context_line":""},{"line_number":4404,"context_line":"    def compute_node_get(self, context, compute_id):"},{"line_number":4405,"context_line":"        \"\"\"Return compute node entry for particular integer ID.\"\"\""},{"line_number":4406,"context_line":"        load_cells()"},{"line_number":4407,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"7a25e98e_526561df","line":4404,"updated":"2017-05-15 15:27:13.000000000","message":"We have the same issue in here as in _find_service, which is we could be returning details about compute with id\u003d1 in cell\u003d1 when we want details about compute with id\u003d2 in cell\u003d2.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fe89a97d399fe1469b43a0e851a2f94ece3b8da3","unresolved":false,"context_lines":[{"line_number":4401,"context_line":"                                        host\u003dhost,"},{"line_number":4402,"context_line":"                                        state\u003dstate)"},{"line_number":4403,"context_line":""},{"line_number":4404,"context_line":"    def compute_node_get(self, context, compute_id):"},{"line_number":4405,"context_line":"        \"\"\"Return compute node entry for particular integer ID.\"\"\""},{"line_number":4406,"context_line":"        load_cells()"},{"line_number":4407,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"1f013ff3_33633c1d","line":4404,"in_reply_to":"7a25e98e_526561df","updated":"2017-05-15 16:09:55.000000000","message":"It\u0027s just not as big of a deal here because we\u0027re never deleting anything by this ID, AFAIK.","commit_id":"f7c7a0350ac7df7c451f989e8d23716726b8e8f8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":4330,"context_line":"                                               payload)"},{"line_number":4331,"context_line":"        return result"},{"line_number":4332,"context_line":""},{"line_number":4333,"context_line":"    @target_host_cell"},{"line_number":4334,"context_line":"    def get_host_uptime(self, context, host_name):"},{"line_number":4335,"context_line":"        \"\"\"Returns the result of calling \"uptime\" on the target host.\"\"\""},{"line_number":4336,"context_line":"        host_name \u003d self._assert_host_exists(context, host_name,"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_cd647cbc","line":4333,"updated":"2017-04-06 01:02:51.000000000","message":"You\u0027ve got to handle the HostMappingNotFound in os-hypervisors for this call now.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":4430,"context_line":"        service \u003d None"},{"line_number":4431,"context_line":"        found_in_cell \u003d None"},{"line_number":4432,"context_line":"        for cell in CELLS:"},{"line_number":4433,"context_line":"            # NOTE(danms): Services can be in cell0, so don\u0027t skip it here"},{"line_number":4434,"context_line":"            try:"},{"line_number":4435,"context_line":"                with nova_context.target_cell(context, cell):"},{"line_number":4436,"context_line":"                    cell_service \u003d objects.Service.get_by_id(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_6df9f07e","line":4433,"updated":"2017-04-06 01:02:51.000000000","message":"I can\u0027t say I really understand when services would show up in cell0.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"34db3d235e4071f42252de768f6e14c361660284","unresolved":false,"context_lines":[{"line_number":4430,"context_line":"        service \u003d None"},{"line_number":4431,"context_line":"        found_in_cell \u003d None"},{"line_number":4432,"context_line":"        for cell in CELLS:"},{"line_number":4433,"context_line":"            # NOTE(danms): Services can be in cell0, so don\u0027t skip it here"},{"line_number":4434,"context_line":"            try:"},{"line_number":4435,"context_line":"                with nova_context.target_cell(context, cell):"},{"line_number":4436,"context_line":"                    cell_service \u003d objects.Service.get_by_id(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_df74fe9b","line":4433,"in_reply_to":"bff0334d_247e41e4","updated":"2017-04-06 17:04:15.000000000","message":"Nevermind you sorted me out in IRC.\n\nOnce we get to multi-cell, the control plane services should go in cell0 so they aren\u0027t in some random cell database.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cb612e0d770c20628ce0a8410bfff699dfbca8bc","unresolved":false,"context_lines":[{"line_number":4430,"context_line":"        service \u003d None"},{"line_number":4431,"context_line":"        found_in_cell \u003d None"},{"line_number":4432,"context_line":"        for cell in CELLS:"},{"line_number":4433,"context_line":"            # NOTE(danms): Services can be in cell0, so don\u0027t skip it here"},{"line_number":4434,"context_line":"            try:"},{"line_number":4435,"context_line":"                with nova_context.target_cell(context, cell):"},{"line_number":4436,"context_line":"                    cell_service \u003d objects.Service.get_by_id(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_8ef08ecb","line":4433,"in_reply_to":"bff0334d_6df9f07e","updated":"2017-04-06 16:18:57.000000000","message":"API, scheduler, and conductor will all show up in cell0.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"af7a7c9adc4a1281e92f03c585fb8c7f5d28a962","unresolved":false,"context_lines":[{"line_number":4430,"context_line":"        service \u003d None"},{"line_number":4431,"context_line":"        found_in_cell \u003d None"},{"line_number":4432,"context_line":"        for cell in CELLS:"},{"line_number":4433,"context_line":"            # NOTE(danms): Services can be in cell0, so don\u0027t skip it here"},{"line_number":4434,"context_line":"            try:"},{"line_number":4435,"context_line":"                with nova_context.target_cell(context, cell):"},{"line_number":4436,"context_line":"                    cell_service \u003d objects.Service.get_by_id(context,"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_247e41e4","line":4433,"in_reply_to":"bff0334d_8ef08ecb","updated":"2017-04-06 16:55:19.000000000","message":"Sorry but how? I thought the services only get created in the database on first startup:\n\nhttps://github.com/openstack/nova/blob/8d9bf947a4c8654a30e016a5d95d9bec55447506/nova/service.py#L154\n\nSo unless you start the service with nova.conf pointed at cell0, they shouldn\u0027t be created there right? Or am I just really dumb and missing something very obvious?","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":4455,"context_line":"        \"\"\"Get service entry for the given service id.\"\"\""},{"line_number":4456,"context_line":"        return self._find_service(context, service_id)"},{"line_number":4457,"context_line":""},{"line_number":4458,"context_line":"    @target_host_cell"},{"line_number":4459,"context_line":"    def service_get_by_compute_host(self, context, host_name):"},{"line_number":4460,"context_line":"        \"\"\"Get service entry for the given compute hostname.\"\"\""},{"line_number":4461,"context_line":"        return objects.Service.get_by_compute_host(context, host_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_ad98186a","line":4458,"updated":"2017-04-06 01:02:51.000000000","message":"You need to handle HostMappingNotFound in os-evacuate.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":4486,"context_line":"        \"\"\"Deletes the specified service.\"\"\""},{"line_number":4487,"context_line":"        self._service_delete(context, service_id)"},{"line_number":4488,"context_line":""},{"line_number":4489,"context_line":"    @target_host_cell"},{"line_number":4490,"context_line":"    def instance_get_all_by_host(self, context, host_name):"},{"line_number":4491,"context_line":"        \"\"\"Return all instances on the given host.\"\"\""},{"line_number":4492,"context_line":"        return objects.InstanceList.get_by_host(context, host_name)"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_0dc26434","line":4489,"updated":"2017-04-06 01:02:51.000000000","message":"Need to handle HostMappingNotFound in os-hypervisors.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"8019f62410620d33daa473a0a106d5567c3f7259","unresolved":false,"context_lines":[{"line_number":4509,"context_line":"        # NOTE(danms): Unfortunately this API exposes database identifiers"},{"line_number":4510,"context_line":"        # which means we really can\u0027t do something efficient here"},{"line_number":4511,"context_line":"        for cell in CELLS:"},{"line_number":4512,"context_line":"            if cell.uuid \u003d\u003d objects.CellMapping.CELL0_UUID:"},{"line_number":4513,"context_line":"                continue"},{"line_number":4514,"context_line":"            with nova_context.target_cell(context, cell):"},{"line_number":4515,"context_line":"                try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_b0124f08","line":4512,"updated":"2017-04-07 23:30:22.000000000","message":"FYI we have a method \u0027cell.is_cell0()\u0027 for this.","commit_id":"74c5bfea6f9616690bc9937d1f32cb4a647b6cdd"}],"nova/exception.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":432,"context_line":""},{"line_number":433,"context_line":""},{"line_number":434,"context_line":"class ServiceNotUnique(Invalid):"},{"line_number":435,"context_line":"    msg_fmt \u003d _(\"Request specifies more than one service.\")"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"class ComputeResourcesUnavailable(ServiceUnavailable):"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_4d698c23","line":435,"updated":"2017-04-06 01:02:51.000000000","message":"This is a bit confusing. The request specifies a single service id, the issue is there are more than one service with that id across multiple cells, so we don\u0027t know which to use.\n\nMaybe we copy the NetworkAmbiguous wording a bit to say something like:\n\n\"More than one possible service found.\"\n\nThe issue we have right now is we don\u0027t have a way to say, specify something more specific, until we have that new microversion with the uuids.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"}],"nova/tests/unit/api/openstack/compute/test_hosts.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"66d29d3db12c9d07ebb7928c719b84881bae6a5c","unresolved":false,"context_lines":[{"line_number":380,"context_line":"            m.side_effect \u003d exception.HostMappingNotFound"},{"line_number":381,"context_line":"            self.controller.show(self.req, s_ref[\u0027host\u0027])"},{"line_number":382,"context_line":"            m.assert_called_once_with(mock.ANY, s_ref[\u0027host\u0027])"},{"line_number":383,"context_line":"        db.service_destroy(ctxt, s_ref[\u0027id\u0027])"},{"line_number":384,"context_line":""},{"line_number":385,"context_line":"    def test_list_hosts_with_zone(self):"},{"line_number":386,"context_line":"        result \u003d self.controller.index(FakeRequestWithNovaZone())"}],"source_content_type":"text/x-python","patch_set":20,"id":"bff0334d_e4185982","line":383,"updated":"2017-04-06 17:08:20.000000000","message":"What is the point in this call?","commit_id":"0da44cc6dac1009eb28e9e87a6aea8938d9e287e"}],"nova/tests/unit/api/openstack/compute/test_services.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"fa3e23bd45986fc7c885cb6d956ca7b56c981453","unresolved":false,"context_lines":[{"line_number":583,"context_line":"                          self.controller.delete, self.req, \u0027abc\u0027)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"    def test_services_delete_duplicate_service(self):"},{"line_number":586,"context_line":"        self.ext_mgr.extensions[\u0027os-extended-services-delete\u0027] \u003d True"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        with mock.patch.object(self.controller, \u0027host_api\u0027) as host_api:"},{"line_number":589,"context_line":"            host_api.service_delete.side_effect \u003d exception.ServiceNotUnique()"}],"source_content_type":"text/x-python","patch_set":19,"id":"bff0334d_4d52ac69","line":586,"updated":"2017-04-06 01:02:51.000000000","message":"I have a feeling this isn\u0027t needed. I know you copied it, but all extensions should be loaded now.","commit_id":"df3b41635eef69f5fe7e008f8b8b1caf6abb6d00"}],"nova/tests/unit/compute/test_host_api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"50d299d6450e5aeb398c904a476514df8845d735","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        self.addCleanup(fake_notifier.reset)"},{"line_number":46,"context_line":"        self.req \u003d fakes.HTTPRequest.blank(\u0027\u0027)"},{"line_number":47,"context_line":"        self.controller \u003d services.ServiceController()"},{"line_number":48,"context_line":"        self.useFixture(fixtures.SingleCellSimple())"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def _compare_obj(self, obj, db_obj):"},{"line_number":51,"context_line":"        test_objects.compare_obj(self, obj, db_obj,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9a30ddce_b4454d18","line":48,"updated":"2017-03-08 20:37:08.000000000","message":"This comment applies to the other similar tests for services and such, but this fixture is just a single cell right, not cell0 and cell1, just one cell. That means we won\u0027t exercise any of the multi-cell iterating that is done in the HostAPI that\u0027s introduced in this change. We should probably actually test the stuff the changes that are iterating over multiple cells and make sure we iterate in the tests too.","commit_id":"eda7646915bcdee58349a9be8310fad1427b5319"}]}
