)]}'
{"nova/scheduler/host_manager.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e003d31a43722972aeb8d69d74b26faeec84c957","unresolved":false,"context_lines":[{"line_number":389,"context_line":"            if aggregate.id in self.host_aggregates_map[host]:"},{"line_number":390,"context_line":"                self.host_aggregates_map[host].remove(aggregate.id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _init_instance_info(self, only_nodes\u003dNone):"},{"line_number":393,"context_line":"        \"\"\"Creates the initial view of instances for all hosts."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"        As this initial population of instance information may take some time,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_ee4dd6c4","line":392,"range":{"start_line":392,"start_character":34,"end_line":392,"end_character":44},"updated":"2016-08-30 14:00:05.000000000","message":"nit: I would probably call just call this nodes or compute_nodes and then document that if it\u0027s None compute nodes will be looked up.","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"9647f8a89c2b3515e802bb5a54b5d93bdaf2a6ef","unresolved":false,"context_lines":[{"line_number":389,"context_line":"            if aggregate.id in self.host_aggregates_map[host]:"},{"line_number":390,"context_line":"                self.host_aggregates_map[host].remove(aggregate.id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _init_instance_info(self, only_nodes\u003dNone):"},{"line_number":393,"context_line":"        \"\"\"Creates the initial view of instances for all hosts."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"        As this initial population of instance information may take some time,"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_a3d58e1c","line":392,"range":{"start_line":392,"start_character":34,"end_line":392,"end_character":44},"in_reply_to":"fa7ab95a_ee4dd6c4","updated":"2016-08-30 20:22:44.000000000","message":"Done","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"68cdc6a2fd646314fdc979d736a81815f99da0be","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(compute_nodes):"},{"line_number":405,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":406,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"},{"line_number":407,"context_line":"            self._instance_info \u003d {}"},{"line_number":408,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_2066c9ec","line":405,"range":{"start_line":405,"start_character":37,"end_line":405,"end_character":56},"updated":"2016-08-30 22:16:00.000000000","message":"it looks like we need admin_context here, it\u0027s required by line 426","commit_id":"54fee831d8d73728eeb859bad1d0d24a7793afab"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"8fde70e00ce34df49e4be88bf9e9a3d870959d72","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(compute_nodes):"},{"line_number":405,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":406,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"},{"line_number":407,"context_line":"            self._instance_info \u003d {}"},{"line_number":408,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa7ab95a_45691c25","line":405,"range":{"start_line":405,"start_character":37,"end_line":405,"end_character":56},"in_reply_to":"fa7ab95a_2066c9ec","updated":"2016-08-30 23:39:14.000000000","message":"Okay, I didn\u0027t see that the instance lookup needed it. What would be best would be to make this a non admin context and then use context.elevated() for the instance lookup. That way it\u0027s clear where it\u0027s needed.","commit_id":"54fee831d8d73728eeb859bad1d0d24a7793afab"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"962a75705154384bff2b0e0a58aa13120bc89993","unresolved":false,"context_lines":[{"line_number":389,"context_line":"            if aggregate.id in self.host_aggregates_map[host]:"},{"line_number":390,"context_line":"                self.host_aggregates_map[host].remove(aggregate.id)"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":"    def _init_instance_info(self, context\u003dNone, compute_nodes\u003dNone):"},{"line_number":393,"context_line":"        \"\"\"Creates the initial view of instances for all hosts."},{"line_number":394,"context_line":""},{"line_number":395,"context_line":"        As this initial population of instance information may take some time,"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_5ee706ac","line":392,"range":{"start_line":392,"start_character":34,"end_line":392,"end_character":46},"updated":"2016-08-31 14:09:09.000000000","message":"I\u0027d rather avoid the optional context parameter. Either require it or generate it locally IMO.","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"5c163f95d8fddf631fd0d3e70384369659f1ebce","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        method in tests."},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"        :param compute_nodes: a list of nodes to populate instances info for"},{"line_number":401,"context_line":"        if equals None, compute_nodes will be looked up in database"},{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(context, compute_nodes):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_9bd0c0f9","line":401,"updated":"2016-08-31 13:56:52.000000000","message":"nit: s/equals/is","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"2092a9ca2a866b9fca65feab037db5f5f6ce98f8","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        method in tests."},{"line_number":399,"context_line":""},{"line_number":400,"context_line":"        :param compute_nodes: a list of nodes to populate instances info for"},{"line_number":401,"context_line":"        if equals None, compute_nodes will be looked up in database"},{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(context, compute_nodes):"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_7e9daa58","line":401,"in_reply_to":"fa7ab95a_9bd0c0f9","updated":"2016-08-31 14:09:06.000000000","message":"Done","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"5c163f95d8fddf631fd0d3e70384369659f1ebce","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        if equals None, compute_nodes will be looked up in database"},{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(context, compute_nodes):"},{"line_number":405,"context_line":"            if not context:"},{"line_number":406,"context_line":"                context \u003d context_module.RequestContext()"},{"line_number":407,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_7b9dbc58","line":404,"updated":"2016-08-31 13:56:52.000000000","message":"nit: we could use the fact it\u0027s a closure and arguments do not need to be passed explicitly","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"2092a9ca2a866b9fca65feab037db5f5f6ce98f8","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        if equals None, compute_nodes will be looked up in database"},{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(context, compute_nodes):"},{"line_number":405,"context_line":"            if not context:"},{"line_number":406,"context_line":"                context \u003d context_module.RequestContext()"},{"line_number":407,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_def15697","line":404,"in_reply_to":"fa7ab95a_7b9dbc58","updated":"2016-08-31 14:09:06.000000000","message":"as discussed, this explicit passing of arguments is required here.","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"682cf72bcfb6c087b650d8e9530ab5e2fd1643df","unresolved":false,"context_lines":[{"line_number":401,"context_line":"        if equals None, compute_nodes will be looked up in database"},{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(context, compute_nodes):"},{"line_number":405,"context_line":"            if not context:"},{"line_number":406,"context_line":"                context \u003d context_module.RequestContext()"},{"line_number":407,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_79e6a4e9","line":404,"in_reply_to":"fa7ab95a_def15697","updated":"2016-08-31 14:15:27.000000000","message":"yeah, I totally forgot context would be moved to the scope of the inner function if we do any assignments there, sorry :(","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"5c163f95d8fddf631fd0d3e70384369659f1ebce","unresolved":false,"context_lines":[{"line_number":442,"context_line":"            LOG.debug(\"END:_async_init_instance_info\")"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"},{"line_number":445,"context_line":"        utils.spawn_n(_async_init_instance_info, context, compute_nodes)"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":448,"context_line":"        \"\"\"Since the caller may specify which filters to use we need"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_dbf16897","line":445,"updated":"2016-08-31 13:56:52.000000000","message":"nit: this change won\u0027t be needed, if we use the fact async_init_instance_info is a closure","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"682cf72bcfb6c087b650d8e9530ab5e2fd1643df","unresolved":false,"context_lines":[{"line_number":442,"context_line":"            LOG.debug(\"END:_async_init_instance_info\")"},{"line_number":443,"context_line":""},{"line_number":444,"context_line":"        # Run this async so that we don\u0027t block the scheduler start-up"},{"line_number":445,"context_line":"        utils.spawn_n(_async_init_instance_info, context, compute_nodes)"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def _choose_host_filters(self, filter_cls_names):"},{"line_number":448,"context_line":"        \"\"\"Since the caller may specify which filters to use we need"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_f9dab416","line":445,"in_reply_to":"fa7ab95a_dbf16897","updated":"2016-08-31 14:15:27.000000000","message":"please disregard this comment","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"26a3a3f2b46749448d898dfe9be446d608370be5","unresolved":false,"context_lines":[{"line_number":424,"context_line":"                                    for curr_node in curr_nodes],"},{"line_number":425,"context_line":"                           \"deleted\": False}"},{"line_number":426,"context_line":"                context \u003d context.elevated()"},{"line_number":427,"context_line":"                result \u003d objects.InstanceList.get_by_filters(context,"},{"line_number":428,"context_line":"                                                             filters)"},{"line_number":429,"context_line":"                instances \u003d result.objects"},{"line_number":430,"context_line":"                LOG.debug(\"Adding %s instances for hosts %s-%s\","}],"source_content_type":"text/x-python","patch_set":8,"id":"fa7ab95a_0f3aa3cd","line":427,"range":{"start_line":427,"start_character":61,"end_line":427,"end_character":68},"updated":"2016-08-31 15:02:46.000000000","message":"Just use context.elevated() here. The way it\u0027s done now any query that is added after this one would accidentally have an elevated context.","commit_id":"4e493eb5532d5ced2772c4138cfdad107297af12"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"9fbf10f8fa36077d4aa071b0941d749161ae156a","unresolved":false,"context_lines":[{"line_number":402,"context_line":"        \"\"\""},{"line_number":403,"context_line":""},{"line_number":404,"context_line":"        def _async_init_instance_info(compute_nodes):"},{"line_number":405,"context_line":"            context \u003d context_module.RequestContext()"},{"line_number":406,"context_line":"            LOG.debug(\"START:_async_init_instance_info\")"},{"line_number":407,"context_line":"            self._instance_info \u003d {}"},{"line_number":408,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9a89bdaa_4cefac1d","line":405,"updated":"2016-09-08 11:00:01.000000000","message":"Nit: all this context switching could have been in a separate patch, I guess, but I am not going to block on that.","commit_id":"cc64a45d98d7576a78a853cc3da8109c31f4b75d"}],"nova/scheduler/ironic_host_manager.py":[{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e003d31a43722972aeb8d69d74b26faeec84c957","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if only_nodes:"},{"line_number":100,"context_line":"            compute_nodes \u003d only_nodes"},{"line_number":101,"context_line":"        else:"},{"line_number":102,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":103,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        non_ironic_computes \u003d [c for c in compute_nodes"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_2eb97ecc","line":102,"updated":"2016-08-30 14:00:05.000000000","message":"An admin context is not required for the lookup so it\u0027s better to instantiate a non admin RequestContext object. Otherwise it\u0027s easy to get confused later about what needs an admin context.","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"9647f8a89c2b3515e802bb5a54b5d93bdaf2a6ef","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        if only_nodes:"},{"line_number":100,"context_line":"            compute_nodes \u003d only_nodes"},{"line_number":101,"context_line":"        else:"},{"line_number":102,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":103,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        non_ironic_computes \u003d [c for c in compute_nodes"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_493863d3","line":102,"in_reply_to":"fa7ab95a_2eb97ecc","updated":"2016-08-30 20:22:44.000000000","message":"Done, do the same for host_manager","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e003d31a43722972aeb8d69d74b26faeec84c957","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            compute_nodes \u003d only_nodes"},{"line_number":101,"context_line":"        else:"},{"line_number":102,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":103,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        non_ironic_computes \u003d [c for c in compute_nodes"},{"line_number":106,"context_line":"                               if not self._is_ironic_compute(c)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_6e0e26e6","line":103,"range":{"start_line":103,"start_character":68,"end_line":103,"end_character":76},"updated":"2016-08-30 14:00:05.000000000","message":"This isn\u0027t strictly necessary because you can iterate through a ComputeNodeList object. So the list comprehension on #105 will still work.","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":14819,"name":"Timofey Durakov","email":"timofei.nd@gmail.com","username":"tdurakov"},"change_message_id":"9647f8a89c2b3515e802bb5a54b5d93bdaf2a6ef","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            compute_nodes \u003d only_nodes"},{"line_number":101,"context_line":"        else:"},{"line_number":102,"context_line":"            context \u003d context_module.get_admin_context()"},{"line_number":103,"context_line":"            compute_nodes \u003d objects.ComputeNodeList.get_all(context).objects"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"        non_ironic_computes \u003d [c for c in compute_nodes"},{"line_number":106,"context_line":"                               if not self._is_ironic_compute(c)]"}],"source_content_type":"text/x-python","patch_set":3,"id":"fa7ab95a_09b65bf8","line":103,"range":{"start_line":103,"start_character":68,"end_line":103,"end_character":76},"in_reply_to":"fa7ab95a_6e0e26e6","updated":"2016-08-30 20:22:44.000000000","message":"as discussed, left this as is for consistency with host_manager.","commit_id":"5dfa705d038a9e73bc711d2da3ddb92830551ce8"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"962a75705154384bff2b0e0a58aa13120bc89993","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        else:"},{"line_number":94,"context_line":"            return host_manager.HostState(host, node)"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def _init_instance_info(self, context\u003dNone, compute_nodes\u003dNone):"},{"line_number":97,"context_line":"        \"\"\"Ironic hosts should not pass instance info.\"\"\""},{"line_number":98,"context_line":"        if not context:"},{"line_number":99,"context_line":"            context \u003d context_module.RequestContext()"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_1e301e07","line":96,"range":{"start_line":96,"start_character":34,"end_line":96,"end_character":46},"updated":"2016-08-31 14:09:09.000000000","message":"Same here, either require it to be passed or generate locally.","commit_id":"61e8e6630a7aaadaaeb2a4c83e972317cfa7d163"}]}
