)]}'
{"nova/scheduler/filter_scheduler.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"cb4c20a85e8cd010581f8d63adad54c98c4154f3","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # traverse this list once. This can bite you if the hosts"},{"line_number":101,"context_line":"        # are being scanned in a filter or weighing function."},{"line_number":102,"context_line":"        hosts \u003d self._get_all_host_states(elevated, spec_obj)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        selected_hosts \u003d []"},{"line_number":105,"context_line":"        num_instances \u003d spec_obj.num_instances"},{"line_number":106,"context_line":"        for num in range(num_instances):"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_a5232556","side":"PARENT","line":103,"updated":"2017-05-22 16:53:58.000000000","message":"unrelated","commit_id":"73e31f66337443516392d8b956b547e97d7aa7d5"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"cb4c20a85e8cd010581f8d63adad54c98c4154f3","unresolved":false,"context_lines":[{"line_number":131,"context_line":"                else:"},{"line_number":132,"context_line":"                    subset \u003d weighed_hosts[:]"},{"line_number":133,"context_line":"                    weighed_hosts \u003d []"},{"line_number":134,"context_line":"                while subset and not allocated:"},{"line_number":135,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":136,"context_line":"                    LOG.debug(\"Selected host: %(host)s\", {\u0027host\u0027: chosen_host})"},{"line_number":137,"context_line":"                    # Allocate the resources used by the instance"}],"source_content_type":"text/x-python","patch_set":6,"id":"ff0f0b1f_659ced69","line":134,"updated":"2017-05-22 16:53:58.000000000","message":"IMHO, we should only retry by the maximum number of attempts and not try to consume the long list of hosts to find a correct target.","commit_id":"934da8a04bf1f42f3724154819b130dd05354483"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5a37140485ce634862ffb13858b2e684cffdb3c4","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            LOG.debug(\"Weighed %(hosts)s\", {\u0027hosts\u0027: weighed_hosts})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"            host_subset_size \u003d CONF.filter_scheduler.host_subset_size"},{"line_number":122,"context_line":"            if host_subset_size \u003c len(weighed_hosts):"},{"line_number":123,"context_line":"                weighed_hosts \u003d weighed_hosts[0:host_subset_size]"},{"line_number":124,"context_line":"            chosen_host \u003d random.choice(weighed_hosts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_f4a6df53","side":"PARENT","line":121,"updated":"2017-05-26 12:06:43.000000000","message":"not really relevant, but host_subset_size is odd. Do people often change the default config setting?","commit_id":"ce689877cef7afe78267b2a791d4a0218405e323"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"23e7ecb438178583a94f24b6644653f1c295e33d","unresolved":false,"context_lines":[{"line_number":118,"context_line":""},{"line_number":119,"context_line":"            LOG.debug(\"Weighed %(hosts)s\", {\u0027hosts\u0027: weighed_hosts})"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"            host_subset_size \u003d CONF.filter_scheduler.host_subset_size"},{"line_number":122,"context_line":"            if host_subset_size \u003c len(weighed_hosts):"},{"line_number":123,"context_line":"                weighed_hosts \u003d weighed_hosts[0:host_subset_size]"},{"line_number":124,"context_line":"            chosen_host \u003d random.choice(weighed_hosts)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_39f9ef4c","side":"PARENT","line":121,"in_reply_to":"ff0f0b1f_f4a6df53","updated":"2017-05-26 13:03:16.000000000","message":"Yes, because besides its intended usage to reduce raciness, it has the effect of spreading instances out. In a cloud with lots of new machines, all of which are roughly identical, similar requests will tend to pick the same machine(s). By setting this larger, the randomness will negate that a bit.","commit_id":"ce689877cef7afe78267b2a791d4a0218405e323"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"86f8ba1a90b56d66559db9c96f47642ca2f8487a","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        for num in range(num_instances):"},{"line_number":107,"context_line":"            instance_uuid \u003d instance_uuids[num]"},{"line_number":108,"context_line":"            # Delete any existing allocations for this instance"},{"line_number":109,"context_line":"            self.reportclient.delete_allocation_for_instance(instance_uuid)"},{"line_number":110,"context_line":"            # Filter local hosts based on requirements ..."},{"line_number":111,"context_line":"            hosts \u003d self.host_manager.get_filtered_hosts(hosts,"},{"line_number":112,"context_line":"                    spec_obj, index\u003dnum)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_7466682c","line":109,"updated":"2017-05-25 18:45:45.000000000","message":"Just noting, this will delete the allocation for an instance on a source host when a move/resize operation occurs. If something fails during the scheduling operation, there will be no allocations for the instance in the placement API. However, this is OK because the allocations will be re-created from the resource tracker the next time the update_available_resource() interval runs on the source host.","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"23e7ecb438178583a94f24b6644653f1c295e33d","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        for num in range(num_instances):"},{"line_number":107,"context_line":"            instance_uuid \u003d instance_uuids[num]"},{"line_number":108,"context_line":"            # Delete any existing allocations for this instance"},{"line_number":109,"context_line":"            self.reportclient.delete_allocation_for_instance(instance_uuid)"},{"line_number":110,"context_line":"            # Filter local hosts based on requirements ..."},{"line_number":111,"context_line":"            hosts \u003d self.host_manager.get_filtered_hosts(hosts,"},{"line_number":112,"context_line":"                    spec_obj, index\u003dnum)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_b9d4dfbe","line":109,"in_reply_to":"ff0f0b1f_7466682c","updated":"2017-05-26 13:03:16.000000000","message":"So is this a good thing or not to have here? IOW, should we rely on the conductor to ensure that any existing allocations are handled properly? This code only has an effect on move/resize, since new instances won\u0027t have any allocations.","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5a37140485ce634862ffb13858b2e684cffdb3c4","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        for num in range(num_instances):"},{"line_number":107,"context_line":"            instance_uuid \u003d instance_uuids[num]"},{"line_number":108,"context_line":"            # Delete any existing allocations for this instance"},{"line_number":109,"context_line":"            self.reportclient.delete_allocation_for_instance(instance_uuid)"},{"line_number":110,"context_line":"            # Filter local hosts based on requirements ..."},{"line_number":111,"context_line":"            hosts \u003d self.host_manager.get_filtered_hosts(hosts,"},{"line_number":112,"context_line":"                    spec_obj, index\u003dnum)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_9481e3c6","line":109,"in_reply_to":"ff0f0b1f_7466682c","updated":"2017-05-26 12:06:43.000000000","message":"True.\n\nBut also, since we\u0027re considering have the conduction be able to create and delete allocations (to deal with the retry situation) then there\u0027s presumably an opportunity to correct placement\u0027s representation of reality a bit sooner in there, as soon as it knows there\u0027s been a failure, assuming it knows (60s is a long time! (or something)).","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6bc4f99b8febf6e145586bfd3db8cd0ba0df970f","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        for num in range(num_instances):"},{"line_number":107,"context_line":"            instance_uuid \u003d instance_uuids[num]"},{"line_number":108,"context_line":"            # Delete any existing allocations for this instance"},{"line_number":109,"context_line":"            self.reportclient.delete_allocation_for_instance(instance_uuid)"},{"line_number":110,"context_line":"            # Filter local hosts based on requirements ..."},{"line_number":111,"context_line":"            hosts \u003d self.host_manager.get_filtered_hosts(hosts,"},{"line_number":112,"context_line":"                    spec_obj, index\u003dnum)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_5caa5119","line":109,"in_reply_to":"ff0f0b1f_b9d4dfbe","updated":"2017-05-26 13:36:14.000000000","message":"Right, good points both. Perhaps it is indeed better to just remove the above line that deletes allocations for the instance and instead do that on the compute node during pre_check or on the conductor before it calls select_destinations().","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"86f8ba1a90b56d66559db9c96f47642ca2f8487a","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    weighed_hosts \u003d []"},{"line_number":134,"context_line":"                while subset and not allocated:"},{"line_number":135,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":136,"context_line":"                    LOG.debug(\"Selected host: %(host)s\", {\u0027host\u0027: chosen_host})"},{"line_number":137,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":138,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":139,"context_line":"                    # This call will return False if the allocation fails"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_6f9e91b9","line":136,"updated":"2017-05-25 18:45:45.000000000","message":"I would recommend changing this log message to:\n\n Attempting allocation %(resources)s against host: %(host)s\n\nand then add an INFO-level statement below line 146 that says:\n\n Allocated %(resources)s against host: %(host)s\n\nI know there is a little logging in the reportclient calls, but a) the logs in _put_allocations() don\u0027t include the host identifier and b) don\u0027t get logged with a nova.scheduler.filter_scheduler module level, so we don\u0027t know what called the put_allocations() method, the resource tracker or the scheduler...","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6bc4f99b8febf6e145586bfd3db8cd0ba0df970f","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    weighed_hosts \u003d []"},{"line_number":134,"context_line":"                while subset and not allocated:"},{"line_number":135,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":136,"context_line":"                    LOG.debug(\"Selected host: %(host)s\", {\u0027host\u0027: chosen_host})"},{"line_number":137,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":138,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":139,"context_line":"                    # This call will return False if the allocation fails"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_3ca79d52","line":136,"in_reply_to":"ff0f0b1f_5c1b7172","updated":"2017-05-26 13:36:14.000000000","message":"ya, after 149..","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"23e7ecb438178583a94f24b6644653f1c295e33d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    weighed_hosts \u003d []"},{"line_number":134,"context_line":"                while subset and not allocated:"},{"line_number":135,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":136,"context_line":"                    LOG.debug(\"Selected host: %(host)s\", {\u0027host\u0027: chosen_host})"},{"line_number":137,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":138,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":139,"context_line":"                    # This call will return False if the allocation fails"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_5c1b7172","line":136,"in_reply_to":"ff0f0b1f_6f9e91b9","updated":"2017-05-26 13:03:16.000000000","message":"That makes sense, although it should be after line 149.","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5a37140485ce634862ffb13858b2e684cffdb3c4","unresolved":false,"context_lines":[{"line_number":133,"context_line":"                    weighed_hosts \u003d []"},{"line_number":134,"context_line":"                while subset and not allocated:"},{"line_number":135,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":136,"context_line":"                    LOG.debug(\"Selected host: %(host)s\", {\u0027host\u0027: chosen_host})"},{"line_number":137,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":138,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":139,"context_line":"                    # This call will return False if the allocation fails"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_b4662729","line":136,"in_reply_to":"ff0f0b1f_6f9e91b9","updated":"2017-05-26 12:06:43.000000000","message":"that\u0027s a good idea","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"734dcf28fac070c026d7b4303601b4ce058ce215","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # traverse this list once. This can bite you if the hosts"},{"line_number":101,"context_line":"        # are being scanned in a filter or weighing function."},{"line_number":102,"context_line":"        hosts \u003d self._get_all_host_states(elevated, spec_obj)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        selected_hosts \u003d []"},{"line_number":105,"context_line":"        num_instances \u003d spec_obj.num_instances"},{"line_number":106,"context_line":"        for num in range(num_instances):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_d2fdfc3a","side":"PARENT","line":103,"updated":"2017-05-31 13:15:20.000000000","message":"I was attached to this blank line.","commit_id":"10a37a4a0d0e841dd2bf83e9ddcb3697c34fbfba"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"643515238c231896147610076a2f82ee0df0c5cc","unresolved":false,"context_lines":[{"line_number":100,"context_line":"        # traverse this list once. This can bite you if the hosts"},{"line_number":101,"context_line":"        # are being scanned in a filter or weighing function."},{"line_number":102,"context_line":"        hosts \u003d self._get_all_host_states(elevated, spec_obj)"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        selected_hosts \u003d []"},{"line_number":105,"context_line":"        num_instances \u003d spec_obj.num_instances"},{"line_number":106,"context_line":"        for num in range(num_instances):"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_4c1144ac","side":"PARENT","line":103,"in_reply_to":"df140735_d2fdfc3a","updated":"2017-06-01 14:29:28.000000000","message":"Superfluous blank lines make readability worse, IMO.\n\nBut as it is an unrelated whitespace change, and we are very strict about such things in Nova, I\u0027ll replace it.","commit_id":"10a37a4a0d0e841dd2bf83e9ddcb3697c34fbfba"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"734dcf28fac070c026d7b4303601b4ce058ce215","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                while subset and not allocated:"},{"line_number":133,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":134,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":135,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":136,"context_line":"                    LOG.debug(\"Attempting allocation %(resources)s against \""},{"line_number":137,"context_line":"                            \"host: %(host)s\", {\"resources\": resources,"},{"line_number":138,"context_line":"                            \"host\": chosen_host})"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_95a1aeac","line":135,"updated":"2017-05-31 13:15:20.000000000","message":"as far as I can see spec_obj doesn\u0027t change throughout this loop and _get_resources_per_request_spec is a pure function (and maybe should be a staticmethod) so can this line be move to outside the for loop, or at least the while loop?\n\nIt doesn\u0027t look like the instance_group changes below have any impact on _get_resources...","commit_id":"2d3065cb0b6ec904591fa3d5719483f5777232e7"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"643515238c231896147610076a2f82ee0df0c5cc","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                while subset and not allocated:"},{"line_number":133,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":134,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":135,"context_line":"                    resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":136,"context_line":"                    LOG.debug(\"Attempting allocation %(resources)s against \""},{"line_number":137,"context_line":"                            \"host: %(host)s\", {\"resources\": resources,"},{"line_number":138,"context_line":"                            \"host\": chosen_host})"}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_d40f03df","line":135,"in_reply_to":"df140735_95a1aeac","updated":"2017-06-01 14:29:28.000000000","message":"Yeah, that makes sense. Done.","commit_id":"2d3065cb0b6ec904591fa3d5719483f5777232e7"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c8cf1e7b18346922e8c5f30bfd1cad29ddccc50b","unresolved":false,"context_lines":[{"line_number":110,"context_line":"        resources \u003d self._get_resources_per_request_spec(spec_obj)"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"        for num in range(num_instances):"},{"line_number":113,"context_line":"            instance_uuid \u003d instance_uuids[num]"},{"line_number":114,"context_line":"            # Filter local hosts based on requirements ..."},{"line_number":115,"context_line":"            hosts \u003d self.host_manager.get_filtered_hosts(hosts,"},{"line_number":116,"context_line":"                    spec_obj, index\u003dnum)"}],"source_content_type":"text/x-python","patch_set":13,"id":"df140735_d3d9d582","line":113,"range":{"start_line":113,"start_character":28,"end_line":113,"end_character":47},"updated":"2017-06-06 15:48:44.000000000","message":"as it was stated somewhere in the dependent change, we don\u0027t precisely enforce that len(instance_uuids) is equal to spec.num_instances. I\u0027m not super anxious by that but I could probably imagine a more conservative approach that would assume that we iterate over the list of passed UUIDs instead of num_instances so we could more easily deprecate this field.","commit_id":"2f49eec92262538daa27ddfcfc6c516ce88f5a2b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c8cf1e7b18346922e8c5f30bfd1cad29ddccc50b","unresolved":false,"context_lines":[{"line_number":135,"context_line":"                else:"},{"line_number":136,"context_line":"                    subset \u003d weighed_hosts[:]"},{"line_number":137,"context_line":"                    weighed_hosts \u003d []"},{"line_number":138,"context_line":"                while subset and not allocated:"},{"line_number":139,"context_line":"                    chosen_host \u003d random.choice(subset)"},{"line_number":140,"context_line":"                    # Allocate the resources used by the instance"},{"line_number":141,"context_line":"                    LOG.debug(\"Attempting allocation %(resources)s against \""}],"source_content_type":"text/x-python","patch_set":13,"id":"df140735_33fed16a","line":138,"range":{"start_line":138,"start_character":16,"end_line":138,"end_character":28},"updated":"2017-06-06 15:48:44.000000000","message":"I don\u0027t see the need for a second loop here.\nThe logic I had in mind was :\n\nwhile weighed_hosts: \n - elect one host based on a random choice of the length of host_subset_size\n - pop that host out of the list\n - try to allocate against it\n - if ok, break the loop, else continue\n\nThat way, you could more easily integrate in a later change which alternative hosts to return for a specific accepted target and stop to retry by the number of alternatives hosts you\u0027re being asked.","commit_id":"2f49eec92262538daa27ddfcfc6c516ce88f5a2b"},{"author":{"_account_id":8264,"name":"Shunli Zhou","username":"ShunliZhou"},"change_message_id":"ad68bea584d80100a6d852df47e4441899e025aa","unresolved":false,"context_lines":[{"line_number":146,"context_line":"                            chosen_host.obj.uuid, instance_uuid, resources)"},{"line_number":147,"context_line":"                    if not allocated:"},{"line_number":148,"context_line":"                        LOG.debug(\"Not able to allocate resources for \""},{"line_number":149,"context_line":"                                \"instance %(inst)s on host %(host)s\","},{"line_number":150,"context_line":"                                {\u0027inst\u0027: instance_uuid, \u0027host\u0027: chosen_host})"},{"line_number":151,"context_line":"                        subset.remove(chosen_host)"},{"line_number":152,"context_line":"                        continue"}],"source_content_type":"text/x-python","patch_set":13,"id":"bf091321_0d1b971b","line":149,"range":{"start_line":149,"start_character":33,"end_line":149,"end_character":41},"updated":"2017-06-08 06:48:58.000000000","message":"seems have indent problem here.","commit_id":"2f49eec92262538daa27ddfcfc6c516ce88f5a2b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c8cf1e7b18346922e8c5f30bfd1cad29ddccc50b","unresolved":false,"context_lines":[{"line_number":166,"context_line":"                spec_obj.instance_group.obj_reset_changes([\u0027hosts\u0027])"},{"line_number":167,"context_line":"        return selected_hosts"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @staticmethod"},{"line_number":170,"context_line":"    def _get_resources_per_request_spec(spec_obj):"},{"line_number":171,"context_line":"        resources \u003d {}"},{"line_number":172,"context_line":""}],"source_content_type":"text/x-python","patch_set":13,"id":"df140735_f8fb9675","line":169,"updated":"2017-06-06 15:48:44.000000000","message":"that looks a correct optimization, but not really needed there, right?","commit_id":"2f49eec92262538daa27ddfcfc6c516ce88f5a2b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c8cf1e7b18346922e8c5f30bfd1cad29ddccc50b","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        return selected_hosts"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    @staticmethod"},{"line_number":170,"context_line":"    def _get_resources_per_request_spec(spec_obj):"},{"line_number":171,"context_line":"        resources \u003d {}"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"        resources[fields.ResourceClass.VCPU] \u003d spec_obj.vcpus"}],"source_content_type":"text/x-python","patch_set":13,"id":"df140735_5867224e","line":170,"updated":"2017-06-06 15:48:44.000000000","message":"nit: we call it twice, but that\u0027s not really a big deal. You could just have passed those resources to _get_all_host_states() by changing its signature but I assume it would add more verbosity to the change.","commit_id":"2f49eec92262538daa27ddfcfc6c516ce88f5a2b"}],"nova/scheduler/host_manager.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"734dcf28fac070c026d7b4303601b4ce058ce215","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        # Host cell (v2) membership"},{"line_number":156,"context_line":"        self.cell_uuid \u003d cell_uuid"},{"line_number":157,"context_line":"        # Host uuid"},{"line_number":158,"context_line":"        self.uuid \u003d None"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        self.updated \u003d None"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_924c249f","line":158,"updated":"2017-05-31 13:15:20.000000000","message":"Would it be worth naming it host_uuid? If it needs a comment then the name is probably not good enough?","commit_id":"2d3065cb0b6ec904591fa3d5719483f5777232e7"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"643515238c231896147610076a2f82ee0df0c5cc","unresolved":false,"context_lines":[{"line_number":155,"context_line":"        # Host cell (v2) membership"},{"line_number":156,"context_line":"        self.cell_uuid \u003d cell_uuid"},{"line_number":157,"context_line":"        # Host uuid"},{"line_number":158,"context_line":"        self.uuid \u003d None"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"        self.updated \u003d None"},{"line_number":161,"context_line":""}],"source_content_type":"text/x-python","patch_set":11,"id":"df140735_743a7734","line":158,"in_reply_to":"df140735_924c249f","updated":"2017-06-01 14:29:28.000000000","message":"No, it doesn\u0027t *need* a comment. I was simply following the pattern of the lines above.","commit_id":"2d3065cb0b6ec904591fa3d5719483f5777232e7"}],"nova/tests/unit/scheduler/test_filter_scheduler.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5a37140485ce634862ffb13858b2e684cffdb3c4","unresolved":false,"context_lines":[{"line_number":435,"context_line":"                                           mock_weigh):"},{"line_number":436,"context_line":"        \"\"\"Check that if all allocations fail, NoValidHost is returned.\"\"\""},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        def _fake_weigh_objects(functions, hosts, options):"},{"line_number":439,"context_line":"            # Rely on the fact that the hosts are named \u0027hostN\u0027 to create a"},{"line_number":440,"context_line":"            # weight that matches N to sort them by name"},{"line_number":441,"context_line":"            wh \u003d [weights.WeighedHost(host, int(host.host[-1:]))"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_565350e3","line":438,"updated":"2017-05-26 12:06:43.000000000","message":"make this staticmethod on the class and re-use from both tests?","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"be1e19492cfe80c05be2f6babd780dc95d7d0fd1","unresolved":false,"context_lines":[{"line_number":435,"context_line":"                                           mock_weigh):"},{"line_number":436,"context_line":"        \"\"\"Check that if all allocations fail, NoValidHost is returned.\"\"\""},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"        def _fake_weigh_objects(functions, hosts, options):"},{"line_number":439,"context_line":"            # Rely on the fact that the hosts are named \u0027hostN\u0027 to create a"},{"line_number":440,"context_line":"            # weight that matches N to sort them by name"},{"line_number":441,"context_line":"            wh \u003d [weights.WeighedHost(host, int(host.host[-1:]))"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff0f0b1f_bc384d3d","line":438,"in_reply_to":"ff0f0b1f_565350e3","updated":"2017-05-26 13:27:01.000000000","message":"Done","commit_id":"cccd3c045f975a0e2d6caa4e6776d4c1021bd254"}]}
