)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1425567455edbb693e47dd9d8518e1482aa0cf2b","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently, the force_hosts is not dealt with the ChanceScheduler,"},{"line_number":10,"context_line":"which makes the force_hosts option meaningless."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I488d08b8a654e931bafdcee0b0facec213838090"},{"line_number":13,"context_line":"Closes-bug: #1441546"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3acd31a7_0a44af18","line":11,"updated":"2015-05-04 20:53:26.000000000","message":"Okay, I thought about why we should leave force_hosts supported in the scheduler since it\u0027s basically not calling the filters and just returning the asked hosts. As it\u0027s done after host_manager.get_all_host_states() is called, it means that the hosts are checked if the related service is there.\n\nSo, saying that the user asks for hostA and hostB, if hostA is not having a related service, it will only return hostB.\n\nSo, while I accept this change, I wonder if it\u0027s good to have such hint having different behaviours.","commit_id":"08b8901400a806808e86673c959f2200626a647b"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"1d594df66850eeea2fe379207dd33aa2391b0aa9","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently, the force_hosts is not dealt with the ChanceScheduler,"},{"line_number":10,"context_line":"which makes the force_hosts option meaningless."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I488d08b8a654e931bafdcee0b0facec213838090"},{"line_number":13,"context_line":"Closes-bug: #1441546"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3acd31a7_ce7fe4a9","line":11,"in_reply_to":"3acd31a7_0a44af18","updated":"2015-05-05 02:33:57.000000000","message":"yeah, you are right. Maybe we can raise a exception.","commit_id":"08b8901400a806808e86673c959f2200626a647b"}],"nova/scheduler/chance.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6da1df374106ff3db2b5c3e543f7a8a455efb82d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa53dc9_b82f4887","line":41,"updated":"2015-04-09 08:05:26.000000000","message":"Well, the ChanceScheduler is given for electing a random host whatever, no ?\n\nI just wonder if it\u0027s not opening a can of worms to add more features to that dumb scheduler. At least, we should properly DocImpact that scheduler stating its limitations.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"0e6822783fa0717ec46eecef99af5e39e5a6c75f","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_7620ef9b","line":41,"in_reply_to":"7ad32947_17878f10","updated":"2015-04-30 21:07:25.000000000","message":"Well, the problem is that force_hosts is not really a hint, it\u0027s just an hack for end-users knowing how the Nova scheduler is working...\n\nSaying --availability-zone myfakeAZ:myhost:mynode just gives an indirection to myhost even if the end-user doesn\u0027t really know what scheduler is in use. \n\nHonestly, I don\u0027t really like that hack, as it\u0027s since maybe the inception of the scheduler, we have to live with it :-(","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"8d1f465ec41bd67d3b47e3f5580e687d7b6bf8fc","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7ad32947_17878f10","line":41,"in_reply_to":"7ad32947_4420b39b","updated":"2015-04-28 12:56:19.000000000","message":"hi, Andrew Lasi, thank you for your review. I think that this change can maintain the consistent behavior to end user and avoid to make the end user confusion.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"3b4474fe49294e13de813bb65a88cc761d57d9de","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa53dc9_96d7a84a","line":41,"in_reply_to":"9aa53dc9_4e7ab678","updated":"2015-04-09 14:09:43.000000000","message":"Mmm, you\u0027re right, the end-user doesn\u0027t have to know which scheduler backend is in use.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"4ec090213db99c5fec3e91a21cef7cddf0ffc0a8","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"7ad32947_4420b39b","line":41,"in_reply_to":"9aa53dc9_96d7a84a","updated":"2015-04-28 12:23:10.000000000","message":"The end user doesn\u0027t need to know which scheduler backend is in use, but if they\u0027re using force_hosts it should be safe to assume they have some knowledge of the deployment setup.  My thoughts are that this is a fine change, but we should probably draw the line here, or we could go the other direction and say that no filtering should happen in the chance scheduler.  Because while a user may wish to use force_hosts it\u0027s still a scheduler hint and the API doesn\u0027t guarantee that it will be honored.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"9d91ceba0d320e37f7912f65c035092ab5c2f1e6","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        \"\"\"Filter a list of hosts based on request_spec.\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa53dc9_4e7ab678","line":41,"in_reply_to":"9aa53dc9_b82f4887","updated":"2015-04-09 08:53:49.000000000","message":"yeah, the ChanceScheduler is used for electing a random host,\nbut if the end user specifies the force_hosts option , this will be against the wish of the user!","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"ab53baa87486097ec93c18d7690530bd74d5d083","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":42,"context_line":"        if force_hosts:"},{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"},{"line_number":47,"context_line":"        return hosts"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_a0306b02","line":44,"updated":"2015-04-14 07:43:55.000000000","message":"hi zhangtralon\nnit: about the intend, how about change it like this:\n\n[host for host in hosts if (host in force_hosts\n                                    and host not in ignore_hosts)]\n\nit will be better to understand the logic.\njust a nit, if you need a respin, please consider this.\n\nthanks, Eli.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"6495dc443250ff9b1ca4746b80ef21fe14979545","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"},{"line_number":47,"context_line":"        return hosts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _schedule(self, context, topic, request_spec, filter_properties):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7aaa499b_535f43e5","line":46,"updated":"2015-04-14 07:52:05.000000000","message":"default the force_hosts is [], so we could put l43~l44 instead of l46 here and remove l42~l44","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"7a021c64ee98bf3accd03be2705ed92d4aa98902","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"},{"line_number":47,"context_line":"        return hosts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _schedule(self, context, topic, request_spec, filter_properties):"}],"source_content_type":"text/x-python","patch_set":1,"id":"dac4157f_dba3954e","line":46,"in_reply_to":"7aaa499b_535f43e5","updated":"2015-04-20 09:39:56.000000000","message":"you mean that it like this:\n\n        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])\n        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])\n        \n        return [host for host in hosts if\n                    host in force_hosts and host not in ignore_hosts]\n\n, I think the logic is wrong. If using the default value of force_hosts, we will always return []. thanks.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":6835,"name":"Kun Huang","email":"gareth@openstacker.org","username":"academicgareth"},"change_message_id":"e6ae1fa8f2a124f7be70d223c80e49e152db510a","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            return [host for host in hosts if"},{"line_number":44,"context_line":"                    host in force_hosts and host not in ignore_hosts]"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"},{"line_number":47,"context_line":"        return hosts"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"    def _schedule(self, context, topic, request_spec, filter_properties):"}],"source_content_type":"text/x-python","patch_set":1,"id":"5ad0253b_37bce26b","line":46,"in_reply_to":"dac4157f_dba3954e","updated":"2015-04-29 00:43:10.000000000","message":"got it","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"63fbb139e9ceef1e7ed481f4ec76a387ddd7a72e","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        ignore_hosts \u003d filter_properties.get(\u0027ignore_hosts\u0027, [])"},{"line_number":43,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":44,"context_line":"        if force_hosts:"},{"line_number":45,"context_line":"            LOG.warning(_LW(\"force_hosts is not sopported by\""},{"line_number":46,"context_line":"                            \"ChanceScheduler\"))"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_7d706940","line":45,"updated":"2015-05-29 20:56:03.000000000","message":"Argh, typo !","commit_id":"86a87e489dc15fb8b1da69a91b826bcc36c35f7b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"63fbb139e9ceef1e7ed481f4ec76a387ddd7a72e","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        force_hosts \u003d filter_properties.get(\u0027force_hosts\u0027, [])"},{"line_number":44,"context_line":"        if force_hosts:"},{"line_number":45,"context_line":"            LOG.warning(_LW(\"force_hosts is not sopported by\""},{"line_number":46,"context_line":"                            \"ChanceScheduler\"))"},{"line_number":47,"context_line":""},{"line_number":48,"context_line":"        hosts \u003d [host for host in hosts if host not in ignore_hosts]"},{"line_number":49,"context_line":"        return hosts"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a016987_bda14196","line":46,"updated":"2015-05-29 20:56:03.000000000","message":"I also think we should add a unittest for this","commit_id":"86a87e489dc15fb8b1da69a91b826bcc36c35f7b"}],"nova/tests/unit/scheduler/test_chance_scheduler.py":[{"author":{"_account_id":6802,"name":"Joel Coffman","email":"jmc7tp@gmail.com","username":"joel-coffman"},"change_message_id":"e2566171f6d4f6d9503429ee2adf9ba32efdb67c","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_filter_hosts_force_hosts(self):"},{"line_number":48,"context_line":"        \"\"\"Test to make sure _filter_hosts() filters original hosts if"},{"line_number":49,"context_line":"        avoid_original_host is True."},{"line_number":50,"context_line":"        \"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        hosts \u003d [\u0027host1\u0027, \u0027host2\u0027, \u0027host3\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_1ea0bf9e","line":49,"updated":"2015-04-30 15:50:02.000000000","message":"Please update the docstring to reference \u0027force_hosts\u0027 rather than \u0027avoid_original_host\u0027.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"d8b45aeedb8b9a0c8aebadb86c87da9e9e7780e0","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def test_filter_hosts_force_hosts(self):"},{"line_number":48,"context_line":"        \"\"\"Test to make sure _filter_hosts() filters original hosts if"},{"line_number":49,"context_line":"        avoid_original_host is True."},{"line_number":50,"context_line":"        \"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        hosts \u003d [\u0027host1\u0027, \u0027host2\u0027, \u0027host3\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_2cc79c46","line":49,"in_reply_to":"3acd31a7_1ea0bf9e","updated":"2015-05-04 11:33:02.000000000","message":"ok,thanks.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":8247,"name":"Thang Pham","email":"thang.g.pham@gmail.com","username":"thang.pham"},"change_message_id":"9392e33c26b36dee454766790bf8fee392926249","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        filter_properties \u003d {\u0027force_hosts\u0027: [\u0027host1\u0027, \u0027host2\u0027]}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        filtered \u003d self.driver._filter_hosts(request_spec, hosts,"},{"line_number":57,"context_line":"                                        filter_properties\u003dfilter_properties)"},{"line_number":58,"context_line":"        self.assertEqual(filtered, [\u0027host1\u0027, \u0027host2\u0027])"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_filter_hosts_no_avoid(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9aa53dc9_a729328c","line":57,"updated":"2015-04-10 13:33:09.000000000","message":"The indentation is off, but pep8 seems to be happy.  Maybe you could put the request_spec and hosts arguments as part of L57 in the next rebase.","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"},{"author":{"_account_id":11530,"name":"zhangtralon","email":"ztralon@hotmail.com","username":"zhangtralon"},"change_message_id":"d8b45aeedb8b9a0c8aebadb86c87da9e9e7780e0","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        filter_properties \u003d {\u0027force_hosts\u0027: [\u0027host1\u0027, \u0027host2\u0027]}"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"        filtered \u003d self.driver._filter_hosts(request_spec, hosts,"},{"line_number":57,"context_line":"                                        filter_properties\u003dfilter_properties)"},{"line_number":58,"context_line":"        self.assertEqual(filtered, [\u0027host1\u0027, \u0027host2\u0027])"},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"    def test_filter_hosts_no_avoid(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3acd31a7_ecc0842c","line":57,"in_reply_to":"9aa53dc9_a729328c","updated":"2015-05-04 11:33:02.000000000","message":"thank you for your advice","commit_id":"d55b7161af7e3a71dd7c668e0d3be37d666035ea"}]}
