)]}'
{"climateclient/base.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"260e337da9a072337bb7220538338a88a2cd86b0","unresolved":false,"context_lines":[{"line_number":49,"context_line":"        resp, body \u003d self.request(url, \u0027GET\u0027)"},{"line_number":50,"context_line":"        if response_key:"},{"line_number":51,"context_line":"            return body[response_key]"},{"line_number":52,"context_line":"        return body"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def _create(self, url, body, response_key):"},{"line_number":55,"context_line":"        \"\"\"Sends create request to Climate."}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_14348b91","line":52,"updated":"2014-05-06 13:41:14.000000000","message":"you can replace the whole 3 above lines by:\n  return body.get(\u0027response_key\u0027, body)","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}],"climateclient/shell.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"260e337da9a072337bb7220538338a88a2cd86b0","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from climateclient.openstack.common import strutils"},{"line_number":34,"context_line":"from climateclient import utils"},{"line_number":35,"context_line":"from climateclient.v1.shell_commands import hosts"},{"line_number":36,"context_line":"from climateclient.v1.shell_commands import leases"},{"line_number":37,"context_line":"from climateclient.v2.shell_commands import hosts as hosts_v2"},{"line_number":38,"context_line":"from climateclient.v2.shell_commands import leases as leases_v2"},{"line_number":39,"context_line":"from climateclient import version as base_version"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_14c2cb58","line":36,"updated":"2014-05-06 13:41:14.000000000","message":"worth changing the import to leases_v1 and hosts_v1 for better clarity","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":10200,"name":"Christian Martinez","email":"chmartinez35@gmail.com","username":"cmart"},"change_message_id":"f0a9f7a8ea458a18362ed58fe9fef0a7b63808ab","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from climateclient.openstack.common import strutils"},{"line_number":34,"context_line":"from climateclient import utils"},{"line_number":35,"context_line":"from climateclient.v1.shell_commands import hosts"},{"line_number":36,"context_line":"from climateclient.v1.shell_commands import leases"},{"line_number":37,"context_line":"from climateclient.v2.shell_commands import hosts as hosts_v2"},{"line_number":38,"context_line":"from climateclient.v2.shell_commands import leases as leases_v2"},{"line_number":39,"context_line":"from climateclient import version as base_version"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_aa936e59","line":36,"in_reply_to":"9ad9bd40_14c2cb58","updated":"2014-05-06 20:13:10.000000000","message":"So do you agree with this approach? What would happen when we have a v3 client? I think that we should find a better way of doing this.. Any suggestions?","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"bfb7d1fa744026550ecb2fecc825a64518162ac3","unresolved":false,"context_lines":[{"line_number":33,"context_line":"from climateclient.openstack.common import strutils"},{"line_number":34,"context_line":"from climateclient import utils"},{"line_number":35,"context_line":"from climateclient.v1.shell_commands import hosts"},{"line_number":36,"context_line":"from climateclient.v1.shell_commands import leases"},{"line_number":37,"context_line":"from climateclient.v2.shell_commands import hosts as hosts_v2"},{"line_number":38,"context_line":"from climateclient.v2.shell_commands import leases as leases_v2"},{"line_number":39,"context_line":"from climateclient import version as base_version"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_06f8c9c1","line":36,"in_reply_to":"9ad9bd40_aa936e59","updated":"2014-05-07 11:42:12.000000000","message":"Well, if we need a V3 client, I agree with the fact we would provide genericity by using getattr or whatever, but for the scope of this change, duplicate modules is enough by me.","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}],"climateclient/v1/client.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"260e337da9a072337bb7220538338a88a2cd86b0","unresolved":false,"context_lines":[{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def __init__(self, climate_url, auth_token):"},{"line_number":35,"context_line":"        #climate_url has the default version at the end. Need to replace that"},{"line_number":36,"context_line":"        #TODO(cmart): need to find a better way of doing this"},{"line_number":37,"context_line":"        self.climate_url \u003d climate_url.replace(\u0027/v1\u0027, \u0027/v1\u0027)"},{"line_number":38,"context_line":"        self.auth_token \u003d auth_token"},{"line_number":39,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_b4c67f66","line":36,"updated":"2014-05-06 13:41:14.000000000","message":"can\u0027t get your problem ? \nas per below line that\u0027s a 1\u003d\u003d1 statement","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}],"climateclient/v2/client.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"260e337da9a072337bb7220538338a88a2cd86b0","unresolved":false,"context_lines":[{"line_number":34,"context_line":"    def __init__(self, climate_url, auth_token):"},{"line_number":35,"context_line":"        #climate_url has the default version at the end. Need to replace that"},{"line_number":36,"context_line":"        #TODO(cmart): need to find a better way of doing this"},{"line_number":37,"context_line":"        self.climate_url \u003d climate_url.replace(\u0027/v1\u0027, \u0027/v2\u0027)"},{"line_number":38,"context_line":"        self.auth_token \u003d auth_token"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.lease \u003d leases.LeaseClientManager(self.climate_url,"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_b49d9f68","line":37,"updated":"2014-05-06 13:41:14.000000000","message":"here you have to assume that the url is correct, no need to hack this","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}],"climateclient/v2/leases.py":[{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":51,"context_line":""},{"line_number":52,"context_line":"            lease \u003d self.get(lease_id)"},{"line_number":53,"context_line":"            cur_end_date \u003d datetime.datetime.strptime(lease[\u0027end_date\u0027],"},{"line_number":54,"context_line":"                                                      \u0027%Y-%m-%dT%H:%M:%S.%f\u0027)"},{"line_number":55,"context_line":"            new_end_date \u003d cur_end_date + delta_sec"},{"line_number":56,"context_line":"            values[\u0027end_date\u0027] \u003d datetime.datetime.strftime("},{"line_number":57,"context_line":"                new_end_date, \u0027%Y-%m-%d %H:%M\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_45df3a0d","line":54,"updated":"2014-05-06 18:51:13.000000000","message":"Please put this and the other datetime format in constants, and use them for v1 too.","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    def list(self, sort_by\u003dNone):"},{"line_number":69,"context_line":"        \"\"\"List all leases.\"\"\""},{"line_number":70,"context_line":"        leases \u003d self._get(\u0027/leases\u0027)"},{"line_number":71,"context_line":"        if sort_by:"},{"line_number":72,"context_line":"            leases \u003d sorted(leases, key\u003dlambda l: l[sort_by])"},{"line_number":73,"context_line":"        return leases"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_25f7965a","line":71,"updated":"2014-05-06 18:51:13.000000000","message":"This code is the same for leases/host controllers for the two versions of the API. Maybe could be moved to BaseClientManager. IIRC someone proposed to move the sort functionality to the API, so moving this to BaseClientManager could be pointless if the sorting thing is moved to the API, but that change could take time to get implemented. So moving this code to parent could be good because now is better than some time.","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"bfb7d1fa744026550ecb2fecc825a64518162ac3","unresolved":false,"context_lines":[{"line_number":68,"context_line":"    def list(self, sort_by\u003dNone):"},{"line_number":69,"context_line":"        \"\"\"List all leases.\"\"\""},{"line_number":70,"context_line":"        leases \u003d self._get(\u0027/leases\u0027)"},{"line_number":71,"context_line":"        if sort_by:"},{"line_number":72,"context_line":"            leases \u003d sorted(leases, key\u003dlambda l: l[sort_by])"},{"line_number":73,"context_line":"        return leases"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_8633f9a9","line":71,"in_reply_to":"9ad9bd40_25f7965a","updated":"2014-05-07 11:42:12.000000000","message":"Agreed with that, we could take example on Ironic for API code factoring.","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}],"climateclient/v2/shell_commands/leases.py":[{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":115,"context_line":"                parsed_args.start \u003d datetime.datetime.strptime("},{"line_number":116,"context_line":"                    parsed_args.start, \u0027%Y-%m-%d %H:%M\u0027)"},{"line_number":117,"context_line":"            except ValueError:"},{"line_number":118,"context_line":"                raise exception.IncorrectLease"},{"line_number":119,"context_line":"        if not isinstance(parsed_args.end, datetime.datetime):"},{"line_number":120,"context_line":"            try:"},{"line_number":121,"context_line":"                parsed_args.end \u003d datetime.datetime.strptime("}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_40280886","line":118,"updated":"2014-05-06 18:51:13.000000000","message":"The exceptions raised in this method should have a message in order to be more user friendly. We need Blazar lovers ;)","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        if parsed_args.start \u003e parsed_args.end:"},{"line_number":126,"context_line":"            raise exception.IncorrectLease"},{"line_number":127,"context_line":"        params[\u0027start\u0027] \u003d datetime.datetime.strftime(parsed_args.start,"},{"line_number":128,"context_line":"                                                     \u0027%Y-%m-%d %H:%M\u0027)"},{"line_number":129,"context_line":"        params[\u0027end\u0027] \u003d datetime.datetime.strftime(parsed_args.end,"},{"line_number":130,"context_line":"                                                   \u0027%Y-%m-%d %H:%M\u0027)"},{"line_number":131,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_651fde6c","line":128,"updated":"2014-05-06 18:51:13.000000000","message":"This should be in a constant too. Please use it in the help of the commands too.","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":134,"context_line":""},{"line_number":135,"context_line":"        physical_reservations \u003d []"},{"line_number":136,"context_line":"        for phys_res_str in parsed_args.physical_reservations:"},{"line_number":137,"context_line":"            err_msg \u003d (\"Invalid physical-reservation argument \u0027%s\u0027. \""},{"line_number":138,"context_line":"                       \"Reservation arguments must be of the \""},{"line_number":139,"context_line":"                       \"form --physical-reservation \u003cmin\u003dint,max\u003dint,\""},{"line_number":140,"context_line":"                       \"hypervisor_properties\u003dstr,resource_properties\u003dstr\u003e\""}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_c0fa58bc","line":137,"updated":"2014-05-06 18:51:13.000000000","message":"i18n this string","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"},{"author":{"_account_id":9331,"name":"Pablo Andres Fuente","email":"pablo.andres.fuente@gmail.com","username":"pafuent"},"change_message_id":"837e8d2a175c5c44e9c6550e900b6c51034acba1","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        reservations \u003d []"},{"line_number":170,"context_line":"        for res_str in parsed_args.reservations:"},{"line_number":171,"context_line":"            err_msg \u003d (\"Invalid reservation argument \u0027%s\u0027. \""},{"line_number":172,"context_line":"                       \"Reservation arguments must be of the \""},{"line_number":173,"context_line":"                       \"form --reservation \u003ckey\u003dvalue\u003e\""},{"line_number":174,"context_line":"                       % res_str)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9ad9bd40_8024d060","line":171,"updated":"2014-05-06 18:51:13.000000000","message":"Move this string near the IncorrectLease exception","commit_id":"4faf0506df62b72165e083f3b004d623a58c53ce"}]}
