)]}'
{"nova/db/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f361ea032e98cf167ce9b70f511ddf46b710be0","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"def compute_node_get_by_nodename(context, nodename):"},{"line_number":248,"context_line":"    \"\"\"Get a compute node by nodename."},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    :param context: The security context (admin)"},{"line_number":251,"context_line":"    :param nodename: Name of the node"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_38dc7e45","line":248,"range":{"start_line":248,"start_character":29,"end_line":248,"end_character":37},"updated":"2019-04-11 13:48:01.000000000","message":"hypervisor_hostname","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8c894791aa3b626c5945f26024ff6f5f37b0a7b7","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"def compute_node_get_by_nodename(context, nodename):"},{"line_number":248,"context_line":"    \"\"\"Get a compute node by nodename."},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    :param context: The security context (admin)"},{"line_number":251,"context_line":"    :param nodename: Name of the node"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_de88b872","line":248,"range":{"start_line":248,"start_character":29,"end_line":248,"end_character":37},"in_reply_to":"3fce034c_38dc7e45","updated":"2019-04-12 02:55:35.000000000","message":"Done","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f361ea032e98cf167ce9b70f511ddf46b710be0","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    :returns: Dictionary-like object containing properties of the compute node,"},{"line_number":254,"context_line":"              including its statistics"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    Raises ComputeHostNotFound if host with the given name doesn\u0027t exist."},{"line_number":257,"context_line":"    \"\"\""},{"line_number":258,"context_line":"    return IMPL.compute_node_get_by_nodename(context, nodename)"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_98d7b224","line":256,"range":{"start_line":256,"start_character":34,"end_line":256,"end_character":38},"updated":"2019-04-11 13:48:01.000000000","message":"hypervisor_hostname","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8c894791aa3b626c5945f26024ff6f5f37b0a7b7","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    :returns: Dictionary-like object containing properties of the compute node,"},{"line_number":254,"context_line":"              including its statistics"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    Raises ComputeHostNotFound if host with the given name doesn\u0027t exist."},{"line_number":257,"context_line":"    \"\"\""},{"line_number":258,"context_line":"    return IMPL.compute_node_get_by_nodename(context, nodename)"},{"line_number":259,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_7e7d046d","line":256,"range":{"start_line":256,"start_character":34,"end_line":256,"end_character":38},"in_reply_to":"3fce034c_98d7b224","updated":"2019-04-12 02:55:35.000000000","message":"Done","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"675b47519632de7edbcb013d806aa7276eed7cb4","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"def compute_node_get_by_nodename(context, nodename):"},{"line_number":248,"context_line":"    \"\"\"Get a compute node by hypervisor_hostname."},{"line_number":249,"context_line":""},{"line_number":250,"context_line":"    :param context: The security context (admin)"},{"line_number":251,"context_line":"    :param nodename: Name of the node"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fce034c_4f9f3450","line":248,"range":{"start_line":248,"start_character":29,"end_line":248,"end_character":48},"updated":"2019-04-12 07:27:04.000000000","message":"is this the same thing as ``name of the node`` ?","commit_id":"70f6018b1ba82359745d2a2bd1fdd7b828c5d3f7"},{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"675b47519632de7edbcb013d806aa7276eed7cb4","unresolved":false,"context_lines":[{"line_number":253,"context_line":"    :returns: Dictionary-like object containing properties of the compute node,"},{"line_number":254,"context_line":"              including its statistics"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    Raises ComputeHostNotFound if hypervisor_hostname with the given name"},{"line_number":257,"context_line":"    doesn\u0027t exist."},{"line_number":258,"context_line":"    \"\"\""},{"line_number":259,"context_line":"    return IMPL.compute_node_get_by_nodename(context, nodename)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3fce034c_afdc9818","line":256,"range":{"start_line":256,"start_character":34,"end_line":256,"end_character":53},"updated":"2019-04-12 07:27:04.000000000","message":"I think it will be better to use same word for params and its\u0027 introduction","commit_id":"70f6018b1ba82359745d2a2bd1fdd7b828c5d3f7"}],"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":686,"context_line":""},{"line_number":687,"context_line":""},{"line_number":688,"context_line":"@pick_context_manager_reader"},{"line_number":689,"context_line":"def compute_node_search_by_hypervisor(context, hypervisor_match):"},{"line_number":690,"context_line":"    field \u003d models.ComputeNode.hypervisor_hostname"},{"line_number":691,"context_line":"    return model_query(context, models.ComputeNode).\\"},{"line_number":692,"context_line":"            filter(field.like(\u0027%%%s%%\u0027 % hypervisor_match)).\\"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_af3a9a30","line":689,"updated":"2019-04-10 13:44:19.000000000","message":"I think we could re-use this for the ironic case.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":28706,"name":"Boxiang Zhu","email":"bxzhu_5355@163.com","username":"ZhuBoxiang"},"change_message_id":"2b93e89d28cd723804a6651cdb1e3002a4de1689","unresolved":false,"context_lines":[{"line_number":658,"context_line":"    results \u003d _compute_node_fetchall(context,"},{"line_number":659,"context_line":"            {\"hypervisor_hostname\": hypervisor_hostname})"},{"line_number":660,"context_line":"    if not results:"},{"line_number":661,"context_line":"        raise exception.ComputeHostNotFound(host\u003dhypervisor_hostname)"},{"line_number":662,"context_line":"    return results[0]"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fce034c_330f75e2","line":661,"range":{"start_line":661,"start_character":14,"end_line":661,"end_character":69},"updated":"2019-04-16 09:31:20.000000000","message":"As far as know, host is not the same as hyervisor_hostname. MHO, should we need an another new exception like ComputeNodeNotFound(nodename\u003dhypervisor_hostname)?","commit_id":"acd64d1d805ad36004bc4c23d74ed7490bd43857"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9a3a49944a0ef2bc954346ca5fde6c659eb6c89d","unresolved":false,"context_lines":[{"line_number":658,"context_line":"    results \u003d _compute_node_fetchall(context,"},{"line_number":659,"context_line":"            {\"hypervisor_hostname\": hypervisor_hostname})"},{"line_number":660,"context_line":"    if not results:"},{"line_number":661,"context_line":"        raise exception.ComputeHostNotFound(host\u003dhypervisor_hostname)"},{"line_number":662,"context_line":"    return results[0]"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fce034c_81ccb761","line":661,"range":{"start_line":661,"start_character":14,"end_line":661,"end_character":69},"in_reply_to":"3fce034c_330f75e2","updated":"2019-04-17 13:16:51.000000000","message":"I think this is fine, we handle ComputeHostNotFound like this generically for all cases of not being able to find a given compute_nodes table record.","commit_id":"acd64d1d805ad36004bc4c23d74ed7490bd43857"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4eb956cc0021ed2740bb2541f9fef56c94c278df","unresolved":false,"context_lines":[{"line_number":658,"context_line":"    results \u003d _compute_node_fetchall(context,"},{"line_number":659,"context_line":"            {\"hypervisor_hostname\": hypervisor_hostname})"},{"line_number":660,"context_line":"    if not results:"},{"line_number":661,"context_line":"        raise exception.ComputeHostNotFound(host\u003dhypervisor_hostname)"},{"line_number":662,"context_line":"    return results[0]"},{"line_number":663,"context_line":""},{"line_number":664,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_017ba7bd","line":661,"range":{"start_line":661,"start_character":44,"end_line":661,"end_character":68},"updated":"2019-05-01 19:04:13.000000000","message":"Will this be confusing?\n\n\"Compute host $nodename could not be found.\"\n\n[Later] Oh, I see y\u0027all already discussed this in PS6.","commit_id":"57465aae77a7af605bbf1ffa29f9dc4b97783922"}],"nova/objects/compute_node.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                                  db_computes)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    @base.remotable_classmethod"},{"line_number":426,"context_line":"    def get_by_hypervisor(cls, context, hypervisor_match):"},{"line_number":427,"context_line":"        db_computes \u003d db.compute_node_search_by_hypervisor(context,"},{"line_number":428,"context_line":"                                                           hypervisor_match)"},{"line_number":429,"context_line":"        return base.obj_make_list(context, cls(context), objects.ComputeNode,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_cf31265b","line":426,"updated":"2019-04-10 13:44:19.000000000","message":"I think this would yield the same result - it\u0027s a LIKE query on the nodename which for Ironic should be an exact match sine the nodenames are UUIDs.\n\nSo if I\u0027m forcing to a specific baremetal node but not specifying a compute service host, like:\n\nopenstack server create --availability_zone nova::c733ba69-0832-4e55-bd4a-781404f2fb36 ...\n\nThen we\u0027d would just query this method with c733ba69-0832-4e55-bd4a-781404f2fb36 for the hypervisor_match value and should get at most 1 entry in the resulting ComputeNodeList.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b9360df5bb9d9d7e8cf7f01d817d3ce2337075e9","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                                  db_computes)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    @base.remotable_classmethod"},{"line_number":426,"context_line":"    def get_by_hypervisor(cls, context, hypervisor_match):"},{"line_number":427,"context_line":"        db_computes \u003d db.compute_node_search_by_hypervisor(context,"},{"line_number":428,"context_line":"                                                           hypervisor_match)"},{"line_number":429,"context_line":"        return base.obj_make_list(context, cls(context), objects.ComputeNode,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_782d2645","line":426,"in_reply_to":"3fce034c_762a1de8","updated":"2019-04-11 13:37:29.000000000","message":"For the non-ironic case, the host:node is 1:1 and should be a FQDN so I don\u0027t think we\u0027d likely hit a case where someone gets more than one node, but I guess it could be possible if for example they have hosts named like:\n\ncompute-1\ncompute-2\ncompute-3\n...\ncompute-11\ncompute-12\n...\netc\n\nAnd then try to build on compute-1 and end up getting back compute-1 and compute-11, so maybe you\u0027re right.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":423,"context_line":"                                  db_computes)"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    @base.remotable_classmethod"},{"line_number":426,"context_line":"    def get_by_hypervisor(cls, context, hypervisor_match):"},{"line_number":427,"context_line":"        db_computes \u003d db.compute_node_search_by_hypervisor(context,"},{"line_number":428,"context_line":"                                                           hypervisor_match)"},{"line_number":429,"context_line":"        return base.obj_make_list(context, cls(context), objects.ComputeNode,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_762a1de8","line":426,"in_reply_to":"5fc1f717_cf31265b","updated":"2019-04-11 12:44:43.000000000","message":"Not done. Well, strictly speaking the nova::\u003cforced_node\u003e hack works for non Ironic case and we should preserve that behavior as is. In those non-Ironic cases with \"like %\u003cnode_name\u003e%\" query, there can be additional hosts we don\u0027t want. Today we filter out those additional hosts by the post filtering we\u0027ve got in get_filtered_hosts() [1].\n\n[1] https://github.com/openstack/nova/blob/3a6d48697feee02380d60beeaa81ef619f9c94e3/nova/scheduler/host_manager.py#L508-L556\n\nHowever, assuming that eventually we\u0027d like to centralize the host/node name filtering here before asking placement and remove that post filtering, I choose to use exact match here in advance. Thoughts?","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f361ea032e98cf167ce9b70f511ddf46b710be0","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    @base.remotable_classmethod"},{"line_number":275,"context_line":"    def get_by_nodename(cls, context, nodename):"},{"line_number":276,"context_line":"        db_compute \u003d db.compute_node_get_by_nodename(context, nodename)"},{"line_number":277,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_98c01253","line":275,"updated":"2019-04-11 13:48:01.000000000","message":"nit: it\u0027d be nice to have a docstring on this to mention that it raises ComputeHostNotFound because I always have to dig into the DB API code to figure that out when writing code against object DB query methods like this and if we just documented the object query methods I wouldn\u0027t have to do that.","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8c894791aa3b626c5945f26024ff6f5f37b0a7b7","unresolved":false,"context_lines":[{"line_number":272,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":"    @base.remotable_classmethod"},{"line_number":275,"context_line":"    def get_by_nodename(cls, context, nodename):"},{"line_number":276,"context_line":"        db_compute \u003d db.compute_node_get_by_nodename(context, nodename)"},{"line_number":277,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":278,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_1ebc0004","line":275,"in_reply_to":"3fce034c_98c01253","updated":"2019-04-12 02:55:35.000000000","message":"Done","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":28706,"name":"Boxiang Zhu","email":"bxzhu_5355@163.com","username":"ZhuBoxiang"},"change_message_id":"2b93e89d28cd723804a6651cdb1e3002a4de1689","unresolved":false,"context_lines":[{"line_number":275,"context_line":"    def get_by_nodename(cls, context, hypervisor_hostname):"},{"line_number":276,"context_line":"        \u0027\u0027\u0027Get by node name (i.e. hypervisor hostname)."},{"line_number":277,"context_line":""},{"line_number":278,"context_line":"        Raises ComputeHostNotFound if hypervisor_hostname with the given name"},{"line_number":279,"context_line":"        doesn\u0027t exist."},{"line_number":280,"context_line":"        \u0027\u0027\u0027"},{"line_number":281,"context_line":"        db_compute \u003d db.compute_node_get_by_nodename("}],"source_content_type":"text/x-python","patch_set":6,"id":"3fce034c_53e001fb","line":278,"range":{"start_line":278,"start_character":15,"end_line":278,"end_character":34},"updated":"2019-04-16 09:31:20.000000000","message":"Same as mentioned.","commit_id":"acd64d1d805ad36004bc4c23d74ed7490bd43857"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":659,"context_line":"                    ctxt, host, node)"},{"line_number":660,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[compute_node])"},{"line_number":661,"context_line":"            except exception.NotFound:"},{"line_number":662,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":663,"context_line":"            return compute_nodes"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        def _get_by_host(ctxt):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_6f47d2a4","line":662,"range":{"start_line":662,"start_character":56,"end_line":662,"end_character":66},"updated":"2019-04-10 13:44:19.000000000","message":"nit: this is redundant","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":659,"context_line":"                    ctxt, host, node)"},{"line_number":660,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[compute_node])"},{"line_number":661,"context_line":"            except exception.NotFound:"},{"line_number":662,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":663,"context_line":"            return compute_nodes"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        def _get_by_host(ctxt):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_162159b5","line":662,"range":{"start_line":662,"start_character":56,"end_line":662,"end_character":66},"in_reply_to":"5fc1f717_6f47d2a4","updated":"2019-04-11 12:44:43.000000000","message":"Done","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":663,"context_line":"            return compute_nodes"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        def _get_by_host(ctxt):"},{"line_number":666,"context_line":"            return objects.ComputeNodeList.get_all_by_host(ctxt, host)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"        def _get_by_node(ctxt):"},{"line_number":669,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_8f56be5b","line":666,"updated":"2019-04-10 13:44:19.000000000","message":"This can also raise ComputeHostNotFound so do you want to handle that and return an empty list like L661 above and L672 below?","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":663,"context_line":"            return compute_nodes"},{"line_number":664,"context_line":""},{"line_number":665,"context_line":"        def _get_by_host(ctxt):"},{"line_number":666,"context_line":"            return objects.ComputeNodeList.get_all_by_host(ctxt, host)"},{"line_number":667,"context_line":""},{"line_number":668,"context_line":"        def _get_by_node(ctxt):"},{"line_number":669,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_961ea96e","line":666,"in_reply_to":"5fc1f717_8f56be5b","updated":"2019-04-11 12:44:43.000000000","message":"Good catch. Yes, I do. Thanks.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":667,"context_line":""},{"line_number":668,"context_line":"        def _get_by_node(ctxt):"},{"line_number":669,"context_line":"            try:"},{"line_number":670,"context_line":"                compute_node \u003d objects.ComputeNode.get_by_nodename(ctxt, node)"},{"line_number":671,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[compute_node])"},{"line_number":672,"context_line":"            except exception.NotFound:"},{"line_number":673,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[])"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_afd61ac2","line":670,"updated":"2019-04-10 13:44:19.000000000","message":"I think we can use ComputeNodeList.get_by_hypervisor here.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                compute_node \u003d objects.ComputeNode.get_by_nodename(ctxt, node)"},{"line_number":671,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[compute_node])"},{"line_number":672,"context_line":"            except exception.NotFound:"},{"line_number":673,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":674,"context_line":"            return compute_nodes"},{"line_number":675,"context_line":""},{"line_number":676,"context_line":"        if host and node:"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_2fcb0a1e","line":673,"range":{"start_line":673,"start_character":56,"end_line":673,"end_character":66},"updated":"2019-04-10 13:44:19.000000000","message":"same as above","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":670,"context_line":"                compute_node \u003d objects.ComputeNode.get_by_nodename(ctxt, node)"},{"line_number":671,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[compute_node])"},{"line_number":672,"context_line":"            except exception.NotFound:"},{"line_number":673,"context_line":"                compute_nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":674,"context_line":"            return compute_nodes"},{"line_number":675,"context_line":""},{"line_number":676,"context_line":"        if host and node:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_f6236dbd","line":673,"range":{"start_line":673,"start_character":56,"end_line":673,"end_character":66},"in_reply_to":"5fc1f717_2fcb0a1e","updated":"2019-04-11 12:44:43.000000000","message":"Done","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":699,"context_line":"                nodes for nodes in nodes_by_cell.values() if nodes)"},{"line_number":700,"context_line":"        except StopIteration:"},{"line_number":701,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":702,"context_line":"            nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        return nodes"},{"line_number":705,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_6ff59250","line":702,"range":{"start_line":702,"start_character":44,"end_line":702,"end_character":54},"updated":"2019-04-10 13:44:19.000000000","message":"same","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":699,"context_line":"                nodes for nodes in nodes_by_cell.values() if nodes)"},{"line_number":700,"context_line":"        except StopIteration:"},{"line_number":701,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":702,"context_line":"            nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        return nodes"},{"line_number":705,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_563fe1d5","line":702,"range":{"start_line":702,"start_character":44,"end_line":702,"end_character":54},"in_reply_to":"5fc1f717_6ff59250","updated":"2019-04-11 12:44:43.000000000","message":"Done","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5ff4c755bee895b3e99f8b47fd24d064da2ca4fa","unresolved":false,"context_lines":[{"line_number":700,"context_line":"        except StopIteration:"},{"line_number":701,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":702,"context_line":"            nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        return nodes"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def refresh_cells_caches(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"5fc1f717_af84dab1","line":703,"updated":"2019-04-10 13:44:19.000000000","message":"What if we have multiple nodes, i.e. the admin specifies a baremetal compute host but not the node, and there are multiple compute nodes mapped to that host - do we raise or something to signal that we still have to do the unlimited GET /allocation_candidates call?","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"5850ccfa2eba178dac09d2f3fab8a4e28a78779b","unresolved":false,"context_lines":[{"line_number":700,"context_line":"        except StopIteration:"},{"line_number":701,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":702,"context_line":"            nodes \u003d objects.ComputeNodeList(objects\u003d[])"},{"line_number":703,"context_line":""},{"line_number":704,"context_line":"        return nodes"},{"line_number":705,"context_line":""},{"line_number":706,"context_line":"    def refresh_cells_caches(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fce034c_76bd3d67","line":703,"in_reply_to":"5fc1f717_af84dab1","updated":"2019-04-11 12:44:43.000000000","message":"Yes, we still have to do the unlimited GET /a_c call, but not in this layer or in this patch, IMO.","commit_id":"2f06b12623d446da0c398e681b3ee1fb68791d31"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"36b6b1597e76b061d32521020013994e1ce9265d","unresolved":false,"context_lines":[{"line_number":700,"context_line":"                nodes for nodes in nodes_by_cell.values() if nodes)"},{"line_number":701,"context_line":"        except StopIteration:"},{"line_number":702,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":703,"context_line":"            nodes \u003d objects.ComputeNodeList()"},{"line_number":704,"context_line":""},{"line_number":705,"context_line":"        return nodes"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fce034c_a42b2fe9","line":703,"updated":"2019-04-15 17:05:08.000000000","message":"I\u0027m pretty sure you could rewrite this as something like:\n\nnodes \u003d next(nodes for nodes in nodes_by_cell.values() if nodes, objects.ComuteNodeList())\n\nThere\u0027s probably some missing parens in there, but the idea is that next  can provide a default instead of handling StopIteration","commit_id":"acd64d1d805ad36004bc4c23d74ed7490bd43857"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0824b1e246abbe91c1233805b47f4533a4581f3c","unresolved":false,"context_lines":[{"line_number":700,"context_line":"                nodes for nodes in nodes_by_cell.values() if nodes)"},{"line_number":701,"context_line":"        except StopIteration:"},{"line_number":702,"context_line":"            # ...or we find no node if none of the cells has a value"},{"line_number":703,"context_line":"            nodes \u003d objects.ComputeNodeList()"},{"line_number":704,"context_line":""},{"line_number":705,"context_line":"        return nodes"},{"line_number":706,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"3fce034c_da7c12ed","line":703,"in_reply_to":"3fce034c_a42b2fe9","updated":"2019-04-15 18:37:32.000000000","message":"Yeah good point, I didn\u0027t know about the default (nor do I use next much).","commit_id":"acd64d1d805ad36004bc4c23d74ed7490bd43857"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4eb956cc0021ed2740bb2541f9fef56c94c278df","unresolved":false,"context_lines":[{"line_number":641,"context_line":"                                 for service in _services})"},{"line_number":642,"context_line":"        return compute_nodes, services"},{"line_number":643,"context_line":""},{"line_number":644,"context_line":"    def _get_cell_by_host(self, ctxt, host):"},{"line_number":645,"context_line":"        \u0027\u0027\u0027Get CellMapping object of a cell the given host belongs to.\u0027\u0027\u0027"},{"line_number":646,"context_line":"        try:"},{"line_number":647,"context_line":"            host_mapping \u003d objects.HostMapping.get_by_host(ctxt, host)"}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_415e7f44","line":644,"range":{"start_line":644,"start_character":8,"end_line":644,"end_character":25},"updated":"2019-05-01 19:04:13.000000000","message":"Could refactor _get_instance_by_host below to use this.","commit_id":"57465aae77a7af605bbf1ffa29f9dc4b97783922"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4eb956cc0021ed2740bb2541f9fef56c94c278df","unresolved":false,"context_lines":[{"line_number":649,"context_line":"        except exception.HostMappingNotFound:"},{"line_number":650,"context_line":"            LOG.warning(\u0027No host-to-cell mapping found for selected \u0027"},{"line_number":651,"context_line":"                        \u0027host %(host)s.\u0027, {\u0027host\u0027: host})"},{"line_number":652,"context_line":"            return"},{"line_number":653,"context_line":""},{"line_number":654,"context_line":"    def get_compute_nodes_by_host_or_node(self, ctxt, host, node, cell\u003dNone):"},{"line_number":655,"context_line":"        \u0027\u0027\u0027Get compute nodes from given host or node\u0027\u0027\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"ffb9cba7_01296799","line":652,"updated":"2019-05-01 19:04:13.000000000","message":"nit: return None explicitly","commit_id":"57465aae77a7af605bbf1ffa29f9dc4b97783922"}],"nova/tests/unit/scheduler/test_host_manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f361ea032e98cf167ce9b70f511ddf46b710be0","unresolved":false,"context_lines":[{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        # Case3: call it with node"},{"line_number":1115,"context_line":"        host \u003d None"},{"line_number":1116,"context_line":"        node \u003d \u0027fake_node\u0027"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        result \u003d self.host_manager.get_compute_nodes_by_host_or_node("},{"line_number":1119,"context_line":"            context, host, node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_f8ca764d","line":1116,"range":{"start_line":1116,"start_character":8,"end_line":1116,"end_character":26},"updated":"2019-04-11 13:48:01.000000000","message":"This is wrong, cn3 nodename is \u0027fake-node\u0027, but the mock covers it up.\n\ncn3 \u003d objects.ComputeNode(host\u003d\u0027fake_host1\u0027, node\u003d\u0027fake-node\u0027)","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8c894791aa3b626c5945f26024ff6f5f37b0a7b7","unresolved":false,"context_lines":[{"line_number":1113,"context_line":""},{"line_number":1114,"context_line":"        # Case3: call it with node"},{"line_number":1115,"context_line":"        host \u003d None"},{"line_number":1116,"context_line":"        node \u003d \u0027fake_node\u0027"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        result \u003d self.host_manager.get_compute_nodes_by_host_or_node("},{"line_number":1119,"context_line":"            context, host, node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_de32f8a7","line":1116,"range":{"start_line":1116,"start_character":8,"end_line":1116,"end_character":26},"in_reply_to":"3fce034c_f8ca764d","updated":"2019-04-12 02:55:35.000000000","message":"Good eye.","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5f361ea032e98cf167ce9b70f511ddf46b710be0","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            context, host, node)"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        self.assertEqual(0, len(result))"},{"line_number":1144,"context_line":"        self.assertFalse(result)"},{"line_number":1145,"context_line":""},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"class HostManagerChangedNodesTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_98a572b8","line":1144,"range":{"start_line":1144,"start_character":8,"end_line":1144,"end_character":32},"updated":"2019-04-11 13:48:01.000000000","message":"Why this?","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"8c894791aa3b626c5945f26024ff6f5f37b0a7b7","unresolved":false,"context_lines":[{"line_number":1141,"context_line":"            context, host, node)"},{"line_number":1142,"context_line":""},{"line_number":1143,"context_line":"        self.assertEqual(0, len(result))"},{"line_number":1144,"context_line":"        self.assertFalse(result)"},{"line_number":1145,"context_line":""},{"line_number":1146,"context_line":""},{"line_number":1147,"context_line":"class HostManagerChangedNodesTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fce034c_de6438bc","line":1144,"range":{"start_line":1144,"start_character":8,"end_line":1144,"end_character":32},"in_reply_to":"3fce034c_98a572b8","updated":"2019-04-12 02:55:35.000000000","message":"Just removed now.","commit_id":"a4543eaf2e55bfb3abd981aa9d743f39cd2559ce"}]}
