)]}'
{"nova/tests/unit/scheduler/test_weights.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"f7aa2d470e4c2f877569a009a6670a3a5801153c","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        weighed_host \u003d self.weight_handler.get_weighed_objects(self.weighers,"},{"line_number":75,"context_line":"                                                               hostinfo, {})"},{"line_number":76,"context_line":"        self.assertEqual(1, len(weighed_host))"},{"line_number":77,"context_line":"        self.assertEqual(\u0027host1\u0027, weighed_host[0].obj.host)"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def test_default_of_spreading_first(self):"},{"line_number":80,"context_line":"        hostinfo_list \u003d self._get_all_hosts()"}],"source_content_type":"text/x-python","patch_set":5,"id":"da86d52c_3e2d0147","line":77,"updated":"2015-02-11 15:05:29.000000000","message":"The asserts below will match with *and* without the change in the \"weights\" module. That\u0027s why I -1 this.\n\nMaybe another assert could be added which verifies that the \"weigher.weigh_objects\" method is *not* called. Another approach could be to use \"None\" as a argument for the \"weighers\" parameter in the \"get_weighed_objects\" method. Any other test approach which would fail without the changes in the \"weights\" module is fine as well.","commit_id":"644b0efe4282d3f107063f4712aede096e0bfdc1"}],"nova/tests/unit/scheduler/weights/test_weights_ram.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"96c9af78d15c64c4700983e1a328e93928381483","unresolved":false,"context_lines":[{"line_number":46,"context_line":"        return [fakes.FakeHostState(host, node, values)"},{"line_number":47,"context_line":"                for host, node, values in host_values]"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    @mock.patch(\u0027nova.weights.BaseWeigher.weigh_objects\u0027)"},{"line_number":50,"context_line":"    def test_only_one_host(self, mock_weigh):"},{"line_number":51,"context_line":"        host_values \u003d ["},{"line_number":52,"context_line":"            (\u0027host1\u0027, \u0027node1\u0027, {\u0027free_ram_mb\u0027: 512}),"}],"source_content_type":"text/x-python","patch_set":8,"id":"dac4157f_f93bcacf","line":49,"updated":"2015-04-21 13:06:29.000000000","message":"Can\u0027t we add this test in here please:\nhttps://github.com/openstack/nova/blob/master/nova/tests/unit/test_weights.py","commit_id":"006644ef75d308e14f5fee0e30a9c72ef30eb68a"}],"nova/tests/unit/test_weights.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"2205ddbf5fd4cedf89dc155e5e7d6422c5997471","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            (\u0027host1\u0027, \u0027node1\u0027, {\u0027free_ram_mb\u0027: 512}),"},{"line_number":63,"context_line":"        ]"},{"line_number":64,"context_line":"        hostinfo \u003d [fakes.FakeHostState(host, node, values)"},{"line_number":65,"context_line":"                    for host, node, values in host_values]"},{"line_number":66,"context_line":""},{"line_number":67,"context_line":"        weight_handler \u003d scheduler_weights.HostWeightHandler()"},{"line_number":68,"context_line":"        weighers \u003d [scheduler_weights.ram.RAMWeigher()]"}],"source_content_type":"text/x-python","patch_set":9,"id":"bab921fb_133962a4","line":65,"updated":"2015-04-25 12:55:44.000000000","message":"nit, why not just write hostinfo \u003d [fakes.FakeHostState(\u0027host1\u0027, \u0027node1\u0027, {....}] If you have to update the patch, how about we simple it.","commit_id":"3251ca82c356e99c923fdf7aaa135fea6cec4e4e"}],"nova/weights.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"fe4a6d7b72328ea3327afb850218389073849696","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        if len(weighed_objs) \u003d\u003d 1:"},{"line_number":134,"context_line":"            return weighed_objs"},{"line_number":135,"context_line":"        else:        "},{"line_number":136,"context_line":"            for weigher_cls in weigher_classes:"},{"line_number":137,"context_line":"                weigher \u003d weigher_cls()"},{"line_number":138,"context_line":"                weights \u003d weigher.weigh_objects(weighed_objs, weighing_properties)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_3174ff34","line":135,"updated":"2014-11-26 06:01:31.000000000","message":"white space ?\nwe don\u0027t need to use else to avoid too many indent changes","commit_id":"3061caca4cdb5423da8672c953e12153931040f0"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"a84a61f9130869a48cbf675d5f04753e3787b39d","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"        if len(weighed_objs) \u003d\u003d 1:"},{"line_number":134,"context_line":"            return weighed_objs"},{"line_number":135,"context_line":"        else:        "},{"line_number":136,"context_line":"            for weigher_cls in weigher_classes:"},{"line_number":137,"context_line":"                weigher \u003d weigher_cls()"},{"line_number":138,"context_line":"                weights \u003d weigher.weigh_objects(weighed_objs, weighing_properties)"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a890539_b1cf0f28","line":135,"in_reply_to":"5a890539_3174ff34","updated":"2014-11-26 06:16:58.000000000","message":"forgot pep8 ... thanks","commit_id":"3061caca4cdb5423da8672c953e12153931040f0"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"df4966deed433a3ad8783fc71d96af86fa2f5b03","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if len(weighed_objs) \u003d\u003d 1:"},{"line_number":133,"context_line":"            return weighed_objs"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        for weigher in weighers:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3acd31a7_7d7076dc","line":132,"updated":"2015-05-05 13:07:15.000000000","message":"so, I feel like if we\u0027re doing early returns it should probably be:\n\n    weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list] \n\n    if len(weighed_obj) \u003c\u003d 1:\n        return weighed_objs\n\nThe multiple early returns is slightly weird","commit_id":"3251ca82c356e99c923fdf7aaa135fea6cec4e4e"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"5db1b5ac0bc6f2e34565f3f8f74ee4be0dcf7e52","unresolved":false,"context_lines":[{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list]"},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        if len(weighed_objs) \u003d\u003d 1:"},{"line_number":133,"context_line":"            return weighed_objs"},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        for weigher in weighers:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3acd31a7_821e495d","line":132,"in_reply_to":"3acd31a7_7d7076dc","updated":"2015-05-05 15:37:07.000000000","message":"ok, let me change it","commit_id":"3251ca82c356e99c923fdf7aaa135fea6cec4e4e"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"c4661e1dfea199246c28bf3eeb0fc9224355e2e8","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        \"\"\"Return a sorted (descending), normalized list of WeighedObjects.\"\"\""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if not obj_list:"},{"line_number":128,"context_line":"            return []"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list]"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3acd31a7_02e479a9","line":128,"updated":"2015-05-05 15:53:29.000000000","message":"I think Sean wanted you to remove these two lines as well? In which case your list comprehension would have to be over \"obj_list or []\"","commit_id":"ef425126a46d6a6cdb67d9cf990bcdbd4ae4523f"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"dadb7c19a84d273030ef88e4e309385645ea89ce","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        \"\"\"Return a sorted (descending), normalized list of WeighedObjects.\"\"\""},{"line_number":126,"context_line":""},{"line_number":127,"context_line":"        if not obj_list:"},{"line_number":128,"context_line":"            return []"},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"        weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list]"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3acd31a7_a2514538","line":128,"in_reply_to":"3acd31a7_02e479a9","updated":"2015-05-05 15:56:10.000000000","message":"yes, you are right , thanks, I missed that","commit_id":"ef425126a46d6a6cdb67d9cf990bcdbd4ae4523f"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"e23c0b95e331761e1fa48827f40c8cafd4d9843a","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    def get_weighed_objects(self, weighers, obj_list, weighing_properties):"},{"line_number":125,"context_line":"        \"\"\"Return a sorted (descending), normalized list of WeighedObjects.\"\"\""},{"line_number":126,"context_line":"        weighed_objs \u003d [self.object_class(obj, 0.0) for obj in obj_list]"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"        if len(weighed_objs) \u003c\u003d 1:"},{"line_number":129,"context_line":"            return weighed_objs"}],"source_content_type":"text/x-python","patch_set":11,"id":"3acd31a7_48b7333a","line":126,"updated":"2015-05-05 16:01:01.000000000","message":"if obj_list is None then an error will be issued whereas previously an empty list would be returned","commit_id":"139835900f630a698127e1637b1c887f17389a03"}]}
