)]}'
{"magnumclient/common/utils.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"36d60ec692c953b503555d75d538eb8e74a930ec","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :returns: list of string filters."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    filters \u003d []"},{"line_number":34,"context_line":"    if isinstance(limit, int):"},{"line_number":35,"context_line":"        filters.append(\u0027limit\u003d%s\u0027 % limit)"},{"line_number":36,"context_line":"    if marker is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027marker\u003d%s\u0027 % marker)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_3127c4cb","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":30},"updated":"2016-03-28 10:19:21.000000000","message":"so you want to support limit\u003d-1 ?","commit_id":"a7b5927c10ae5cca8b92cc2d1d5634c09dc9787b"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"5dd6d3d5664a9c238ad4314b3ee47ada85fb5f6b","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :returns: list of string filters."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    filters \u003d []"},{"line_number":34,"context_line":"    if isinstance(limit, int):"},{"line_number":35,"context_line":"        filters.append(\u0027limit\u003d%s\u0027 % limit)"},{"line_number":36,"context_line":"    if marker is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027marker\u003d%s\u0027 % marker)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_440c8494","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":30},"in_reply_to":"ba0121b8_fe3607b3","updated":"2016-03-29 01:31:34.000000000","message":"@hongbin, the thing is, we don\u0027t want to waste a REST call to let m-api do a validation there. as far as we can check the limit is not valid, I think we\u0027d better to do it in client side.\n\nWe can imagine that if you are in a large scale cluster, it\u0027s bad to let m-api to do validation there.\n\nAfter checking python-novaclient code:\n\n--------------------------------------\n\nhmm.. I checked what python-nova client does for list servers, we can take a look at it\n\nfor limit \u003d -1 (which means no limit, then we should ignore passing limit, just let m-api decide limit value)\nfor limit \u003c -1 (let m-api raise 400 and tell user we require limit \u003e\u003d0)\n\nso we change the code looks like:\n\n if isinstance(limit, int) and limit !\u003d -1:\n     ilters.append(\u0027limit\u003d%s\u0027 % limit)\n\ndoes this make sense?\n\ncheck this https://github.com/openstack/python-novaclient/blob/master/novaclient/v2/servers.py#L736\n\n\n@wangqun, it would be better to having a UT cover this change.","commit_id":"a7b5927c10ae5cca8b92cc2d1d5634c09dc9787b"},{"author":{"_account_id":18386,"name":"wangqun","email":"bjwqun@cn.ibm.com","username":"wangqun"},"change_message_id":"51a5bd38309404dd660e701f3b5ef899849e25f9","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :returns: list of string filters."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    filters \u003d []"},{"line_number":34,"context_line":"    if isinstance(limit, int):"},{"line_number":35,"context_line":"        filters.append(\u0027limit\u003d%s\u0027 % limit)"},{"line_number":36,"context_line":"    if marker is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027marker\u003d%s\u0027 % marker)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_ec844fd5","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":30},"in_reply_to":"da0c15f0_3127c4cb","updated":"2016-03-28 10:38:27.000000000","message":"@Eli, No, we have judged in the link https://github.com/openstack/magnum/blob/master/magnum/api/utils.py#L35. And if judging the \"limit\u003e0\" firstly here, when we list with limit \"negative number\", it can not be append the filters. But \"limit\" is none in the https://github.com/openstack/magnum/blob/master/magnum/api/controllers/v1/container.py#L339. So the limit with \"negative number\" will be validate.","commit_id":"a7b5927c10ae5cca8b92cc2d1d5634c09dc9787b"},{"author":{"_account_id":11536,"name":"hongbin","email":"hongbin034@gmail.com","username":"hongbin"},"change_message_id":"74dfb31979d36a25ac8a13ca42986280b85fcd7b","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :returns: list of string filters."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    filters \u003d []"},{"line_number":34,"context_line":"    if isinstance(limit, int):"},{"line_number":35,"context_line":"        filters.append(\u0027limit\u003d%s\u0027 % limit)"},{"line_number":36,"context_line":"    if marker is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027marker\u003d%s\u0027 % marker)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba0121b8_fe3607b3","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":30},"in_reply_to":"da0c15f0_571d08bc","updated":"2016-03-28 23:21:23.000000000","message":"I think it is not bad to send invalid argument to m-api, because it is easier to validate the argument there. @Eli, what is your concern about sending invalid argument to the server? I will reconsider my position if you have a valid concern.","commit_id":"a7b5927c10ae5cca8b92cc2d1d5634c09dc9787b"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"b5eb468374bb81e6e72a6f6f0167a0638c0eb443","unresolved":false,"context_lines":[{"line_number":31,"context_line":"    :returns: list of string filters."},{"line_number":32,"context_line":"    \"\"\""},{"line_number":33,"context_line":"    filters \u003d []"},{"line_number":34,"context_line":"    if isinstance(limit, int):"},{"line_number":35,"context_line":"        filters.append(\u0027limit\u003d%s\u0027 % limit)"},{"line_number":36,"context_line":"    if marker is not None:"},{"line_number":37,"context_line":"        filters.append(\u0027marker\u003d%s\u0027 % marker)"}],"source_content_type":"text/x-python","patch_set":1,"id":"da0c15f0_571d08bc","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":30},"in_reply_to":"da0c15f0_ec844fd5","updated":"2016-03-28 11:05:27.000000000","message":"This is not a wise chose to let m-api to raise exception. \n\nnegative number is not send to m-api at all.\n\nif you really want to prevent user to send invalid limit value , just raise it out.","commit_id":"a7b5927c10ae5cca8b92cc2d1d5634c09dc9787b"}],"magnumclient/tests/test_utils.py":[{"author":{"_account_id":9591,"name":"Ton Ngo","email":"ton@us.ibm.com","username":"tango"},"change_message_id":"f6d9fc120d156e675044fbe64740c7ae565c041b","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        result \u003d utils.common_filters(limit\u003d42)"},{"line_number":30,"context_line":"        self.assertEqual([\u0027limit\u003d42\u0027], result)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def test_limit_0(self):"},{"line_number":33,"context_line":"        result \u003d utils.common_filters(limit\u003d0)"},{"line_number":34,"context_line":"        self.assertEqual([], result)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_2fb128e2","side":"PARENT","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":26},"updated":"2016-03-30 06:00:43.000000000","message":"Not sure why you would want to remove this test, since it seems to test the code path being changed.  It just needs to be updated to reflect the new behavior.  We might want to add a test for -1 as well.","commit_id":"dc51b7bcd43b3e49907cf69c1cee33051a270ff8"},{"author":{"_account_id":18386,"name":"wangqun","email":"bjwqun@cn.ibm.com","username":"wangqun"},"change_message_id":"75fb53f8753c92db3b8ac16dbab667a634a10548","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        result \u003d utils.common_filters(limit\u003d42)"},{"line_number":30,"context_line":"        self.assertEqual([\u0027limit\u003d42\u0027], result)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def test_limit_0(self):"},{"line_number":33,"context_line":"        result \u003d utils.common_filters(limit\u003d0)"},{"line_number":34,"context_line":"        self.assertEqual([], result)"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba0121b8_24af462b","side":"PARENT","line":32,"range":{"start_line":32,"start_character":4,"end_line":32,"end_character":26},"in_reply_to":"ba0121b8_2fb128e2","updated":"2016-03-31 06:30:11.000000000","message":"@Ton, you are right. I understand it. It is necessary to add the unit test.","commit_id":"dc51b7bcd43b3e49907cf69c1cee33051a270ff8"}]}
