)]}'
{"zun/api/controllers/v1/zun_services.py":[{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"5466124a6e32270c155d37257d3bffd6f978f146","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        objects.ZunService.get_by_host_and_binary("},{"line_number":114,"context_line":"            context, host, binary).destroy(context)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    @pecan.expose(\u0027json\u0027)"},{"line_number":117,"context_line":"    @exception.wrap_pecan_controller_exception"},{"line_number":118,"context_line":"    def enable(self, **kwargs):"},{"line_number":119,"context_line":"        context \u003d pecan.request.context"},{"line_number":120,"context_line":"        policy.enforce(context, \"zun-service:enable\","},{"line_number":121,"context_line":"                       action\u003d\"zun-service:enable\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_3e5053d4","line":118,"range":{"start_line":116,"start_character":4,"end_line":118,"end_character":31},"updated":"2017-05-09 10:07:00.000000000","message":"if possible please add validation here too.","commit_id":"5e6c89720d0d9aea8e7f8a371eec05797ce6a5f7"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"5466124a6e32270c155d37257d3bffd6f978f146","unresolved":false,"context_lines":[{"line_number":121,"context_line":"                       action\u003d\"zun-service:enable\")"},{"line_number":122,"context_line":"        return self._enable(context, kwargs)"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"    @pecan.expose(\u0027json\u0027)"},{"line_number":125,"context_line":"    @exception.wrap_pecan_controller_exception"},{"line_number":126,"context_line":"    def disable(self, **kwargs):"},{"line_number":127,"context_line":"        context \u003d pecan.request.context"},{"line_number":128,"context_line":"        policy.enforce(context, \"zun-service:disable\","},{"line_number":129,"context_line":"                       action\u003d\"zun-service:disable\")"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f044301_fe630bb0","line":126,"range":{"start_line":124,"start_character":4,"end_line":126,"end_character":32},"updated":"2017-05-09 10:07:00.000000000","message":"ditto","commit_id":"5e6c89720d0d9aea8e7f8a371eec05797ce6a5f7"},{"author":{"_account_id":16277,"name":"Pradeep Kumar Singh","email":"ps4openstack@gmail.com","username":"pradeep_singh"},"change_message_id":"dc0b81470a4733575c5f1c2cb3ce471240bdcccf","unresolved":false,"context_lines":[{"line_number":54,"context_line":"    \"\"\"REST controller for zun-services.\"\"\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    _custom_actions \u003d {"},{"line_number":57,"context_line":"        \u0027enable\u0027: [\u0027POST\u0027],"},{"line_number":58,"context_line":"        \u0027disable\u0027: [\u0027POST\u0027],"},{"line_number":59,"context_line":"    }"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def __init__(self, **kwargs):"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f044301_f2b9f0cb","line":58,"range":{"start_line":57,"start_character":8,"end_line":58,"end_character":28},"updated":"2017-05-10 05:12:51.000000000","message":"I think this is just a update in DB, shouldn\u0027t it be PUT call rather than POST? What do you think?","commit_id":"55f663c8c8672c20e39e327a512f1438417c0f4a"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"73e17950dee83275daae99bcb0a2ef9f08cfb5fd","unresolved":false,"context_lines":[{"line_number":65,"context_line":"    def _update(self, context, host, binary, payload):"},{"line_number":66,"context_line":"        \"\"\"Do the actual update\"\"\""},{"line_number":67,"context_line":"        objects.ZunService.get_by_host_and_binary("},{"line_number":68,"context_line":"            context, host, binary).update(context, payload)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def _enable_disable(self, context, body, params_to_update):"},{"line_number":71,"context_line":"        \"\"\"Enable/Disable scheduling for a service.\"\"\""}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_5a271466","line":68,"range":{"start_line":68,"start_character":35,"end_line":68,"end_character":41},"updated":"2017-05-13 15:04:24.000000000","message":"The method get_by_host_and_binary might return None (https://github.com/openstack/zun/blob/master/zun/objects/zun_service.py#L63). Therefore, we need to check if the object is None before calling \"update\" here. Otherwise, it will fail.","commit_id":"c2bdfc843c04beb9c22047831b371d14ba148791"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"73e17950dee83275daae99bcb0a2ef9f08cfb5fd","unresolved":false,"context_lines":[{"line_number":67,"context_line":"        objects.ZunService.get_by_host_and_binary("},{"line_number":68,"context_line":"            context, host, binary).update(context, payload)"},{"line_number":69,"context_line":""},{"line_number":70,"context_line":"    def _enable_disable(self, context, body, params_to_update):"},{"line_number":71,"context_line":"        \"\"\"Enable/Disable scheduling for a service.\"\"\""},{"line_number":72,"context_line":"        return self._update(context, body[\u0027host\u0027], body[\u0027binary\u0027],"},{"line_number":73,"context_line":"                            params_to_update)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_3a5e88e6","line":70,"range":{"start_line":70,"start_character":8,"end_line":70,"end_character":23},"updated":"2017-05-13 15:04:24.000000000","message":"nit: suggest to rename it to _enable_or_disable. It reads better to me.","commit_id":"c2bdfc843c04beb9c22047831b371d14ba148791"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"73e17950dee83275daae99bcb0a2ef9f08cfb5fd","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    @exception.wrap_pecan_controller_exception"},{"line_number":120,"context_line":"    @validation.validate_query_param(pecan.request,"},{"line_number":121,"context_line":"                                     schema.query_param_enable)"},{"line_number":122,"context_line":"    def enable(self, **kwargs):"},{"line_number":123,"context_line":"        context \u003d pecan.request.context"},{"line_number":124,"context_line":"        policy.enforce(context, \"zun-service:enable\","},{"line_number":125,"context_line":"                       action\u003d\"zun-service:enable\")"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_faf4a0d1","line":122,"range":{"start_line":122,"start_character":8,"end_line":122,"end_character":14},"updated":"2017-05-13 15:04:24.000000000","message":"Mind adding unit test cases for \"enable\" and \"disable\". Simply add the two test cases in this file is enough: https://github.com/openstack/zun/blob/master/zun/tests/unit/api/controllers/v1/test_zun_service.py .","commit_id":"c2bdfc843c04beb9c22047831b371d14ba148791"}],"zun/objects/zun_service.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"73e17950dee83275daae99bcb0a2ef9f08cfb5fd","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        self.save()"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    @base.remotable"},{"line_number":156,"context_line":"    def update(self, context, kwargs):"},{"line_number":157,"context_line":"        \"\"\"Update the ZunService, then save it."},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"        :param context: Security context. NOTE: This should only"}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_5a0ef4e5","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":14},"updated":"2017-05-13 15:04:24.000000000","message":"Mind adding unit test for this method. Just add a test case in this file is enough: https://github.com/openstack/zun/blob/master/zun/tests/unit/objects/test_zun_service.py","commit_id":"c2bdfc843c04beb9c22047831b371d14ba148791"}],"zun/tests/unit/api/controllers/v1/test_zun_service.py":[{"author":{"_account_id":23055,"name":"miaohb","email":"miao.hongbao@zte.com.cn","username":"miaohb"},"change_message_id":"945e0dd43bff4509f0af8bb4093df7ab033302da","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            self.assertEqual(elem[\u0027id\u0027], i + 1)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    @mock.patch.object(objects.ZunService, \u0027update\u0027)"},{"line_number":69,"context_line":"    def test_enable(self, mock_enable):"},{"line_number":70,"context_line":"        self._rpc_api_reply()"},{"line_number":71,"context_line":"        mock_enable.return_value \u003d {"},{"line_number":72,"context_line":"            \u0027service\u0027: {"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff0f0b1f_3f6f6893","line":69,"range":{"start_line":69,"start_character":8,"end_line":69,"end_character":19},"updated":"2017-05-19 09:00:45.000000000","message":"Hi Hongbin, the test cases here have some problems. Would you please give some advice? thanks a lot.","commit_id":"40b695393f3046fa48193d0767b1b2ff1405956c"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"a660c226ea28f45d593c171cf2873842a09d50a8","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            self.assertEqual(elem[\u0027id\u0027], i + 1)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    @mock.patch.object(objects.ZunService, \u0027update\u0027)"},{"line_number":69,"context_line":"    def test_enable(self, mock_enable):"},{"line_number":70,"context_line":"        self._rpc_api_reply()"},{"line_number":71,"context_line":"        mock_enable.return_value \u003d {"},{"line_number":72,"context_line":"            \u0027service\u0027: {"}],"source_content_type":"text/x-python","patch_set":5,"id":"ff0f0b1f_50879b10","line":69,"range":{"start_line":69,"start_character":8,"end_line":69,"end_character":19},"in_reply_to":"ff0f0b1f_3f6f6893","updated":"2017-05-19 18:12:08.000000000","message":"I saw @Pradeep just answered your question in another reply. As he mentioned, you need to mock \u0027get_by_host_and_binary\u0027 as well.","commit_id":"40b695393f3046fa48193d0767b1b2ff1405956c"}],"zun/tests/unit/objects/test_objects.py":[{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"73e17950dee83275daae99bcb0a2ef9f08cfb5fd","unresolved":false,"context_lines":[{"line_number":361,"context_line":"    \u0027NUMATopology\u0027: \u00271.0-b54086eda7e4b2e6145ecb6ee2c925ab\u0027,"},{"line_number":362,"context_line":"    \u0027ResourceClass\u0027: \u00271.1-d661c7675b3cd5b8c3618b68ba64324e\u0027,"},{"line_number":363,"context_line":"    \u0027ResourceProvider\u0027: \u00271.0-92b427359d5a4cf9ec6c72cbe630ee24\u0027,"},{"line_number":364,"context_line":"    \u0027ZunService\u0027: \u00271.0-2a19ab9987a746621b2ada02d8aadf22\u0027,"},{"line_number":365,"context_line":"    \u0027ComputeNode\u0027: \u00271.4-d73867b95a525c60cbbb5e98c0dc0dd6\u0027,"},{"line_number":366,"context_line":"}"},{"line_number":367,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1f013ff3_fa6f0090","side":"PARENT","line":364,"range":{"start_line":364,"start_character":21,"end_line":364,"end_character":22},"updated":"2017-05-13 15:04:24.000000000","message":"Please bump the version to 1.1","commit_id":"984563830f4374dd940cc12cf85cb23eaac272af"}]}
