)]}'
{"quantum/plugins/nicira/nicira_nvp_plugin/nvplib.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"b5aba8c90da8fc7b24d8710eafc46289b74b5e95","unresolved":false,"context_lines":[{"line_number":147,"context_line":"def _check_and_truncate_name(display_name):"},{"line_number":148,"context_line":"    # Safety first"},{"line_number":149,"context_line":"    if not display_name:"},{"line_number":150,"context_line":"        return"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bp%2BY%3D","line":150,"updated":"2013-02-22 17:13:15.000000000","message":"this is a bit odd, as if the name is \"\" (empty string), name will end up being set to None.  Is that the intention?","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":147,"context_line":"def _check_and_truncate_name(display_name):"},{"line_number":148,"context_line":"    # Safety first"},{"line_number":149,"context_line":"    if not display_name:"},{"line_number":150,"context_line":"        return"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BpEI%3D","line":150,"in_reply_to":"AAAAM3%2F%2Bp%2BY%3D","updated":"2013-02-23 14:15:25.000000000","message":"Good point. I wanted to avoid the unsigthly \"is not None\" check.\nReturning None in place of \"\" won\u0027t make a big difference.\nHowever this can be easily sorted by changing line 150 into\n\nreturn display_name","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"b5aba8c90da8fc7b24d8710eafc46289b74b5e95","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bp%2B0%3D","line":153,"updated":"2013-02-22 17:13:15.000000000","message":"not sure this should be a warning, as it is actually just part of normal operations.","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":150,"context_line":"        return"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BpEE%3D","line":153,"in_reply_to":"AAAAM3%2F%2Bp%2B0%3D","updated":"2013-02-23 14:15:25.000000000","message":"You\u0027re right.\nI debugged the patch with verbose\u003dFalse and forgot to set this back to debug","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"b5aba8c90da8fc7b24d8710eafc46289b74b5e95","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"def get_cluster_version(cluster):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bp98%3D","line":154,"updated":"2013-02-22 17:13:15.000000000","message":"I\u0027m not a python efficiency expert, but I wonder if this results in an unnecessary copy if the name is under max-len.  What about.\n\nIf display_name and len(display_name) \u003e MAX_DISPLAY_NAME_LEN: \n    return display_name[:MAX_DISPLAY_NAME_LEN]\nreturn display_name","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.warning(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                      \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":""},{"line_number":157,"context_line":"def get_cluster_version(cluster):"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BpEA%3D","line":154,"in_reply_to":"AAAAM3%2F%2Bp98%3D","updated":"2013-02-23 14:15:25.000000000","message":"Done\n\nBtw, I think with strings it\u0027s always a copy regardless of whether you return part or the whole of it.","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"change_message_id":"0c6127a01011083eb7ab8ed739d354cf7dce20b8","unresolved":false,"context_lines":[{"line_number":149,"context_line":"    if not display_name:"},{"line_number":150,"context_line":"        return display_name"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.debug(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                    \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    if display_name and len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":155,"context_line":"        return display_name[:MAX_DISPLAY_NAME_LEN]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2Bmrk%3D","line":152,"updated":"2013-02-26 01:36:05.000000000","message":"No need for a space after \"length.\"?","commit_id":"4c80887d8259e6ec18d787b8f1948f6751d4eb89"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":149,"context_line":"    if not display_name:"},{"line_number":150,"context_line":"        return display_name"},{"line_number":151,"context_line":"    if len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":152,"context_line":"        LOG.debug(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\""},{"line_number":153,"context_line":"                    \"It will be truncated on NVP\"), display_name)"},{"line_number":154,"context_line":"    if display_name and len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":155,"context_line":"        return display_name[:MAX_DISPLAY_NAME_LEN]"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2Bku0%3D","line":152,"in_reply_to":"AAAAM3%2F%2Bmrk%3D","updated":"2013-02-27 00:01:20.000000000","message":"Done","commit_id":"4c80887d8259e6ec18d787b8f1948f6751d4eb89"},{"author":{"_account_id":4598,"name":"Giampaolo Lauria","email":"lauria@us.ibm.com","username":"lauria"},"change_message_id":"768c3cd1bf938921536b70a0b385b5072bd907b5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    if display_name and len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":155,"context_line":"        return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":156,"context_line":"    return display_name"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"def get_cluster_version(cluster):"},{"line_number":160,"context_line":"    \"\"\"Return major/minor version #\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2BmZU%3D","line":157,"updated":"2013-02-26 06:15:58.000000000","message":"Salvatore, could the fcn be rewritten as:\n\ndef _check_and_truncate_name(display_name):\n    if display_name and len(display_name) \u003e  MAX_DISPLAY_NAME_LEN:\n       LOG.debug(_(\"Specified name:\u0027%s\u0027 exceeds maximum length.\"\n       \"It will be truncated on NVP\"), display_name)\n       return display_name[:MAX_DISPLAY_NAME_LEN]\n    return display_name","commit_id":"4c80887d8259e6ec18d787b8f1948f6751d4eb89"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":154,"context_line":"    if display_name and len(display_name) \u003e MAX_DISPLAY_NAME_LEN:"},{"line_number":155,"context_line":"        return display_name[:MAX_DISPLAY_NAME_LEN]"},{"line_number":156,"context_line":"    return display_name"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"def get_cluster_version(cluster):"},{"line_number":160,"context_line":"    \"\"\"Return major/minor version #\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAM3%2F%2BkvA%3D","line":157,"in_reply_to":"AAAAM3%2F%2BmZU%3D","updated":"2013-02-27 00:01:20.000000000","message":"Done","commit_id":"4c80887d8259e6ec18d787b8f1948f6751d4eb89"},{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"unresolved":false,"context_lines":[{"line_number":661,"context_line":"    \"\"\"Return (url, cluster_id) of port or raises ResourceNotFound"},{"line_number":662,"context_line":"    \"\"\""},{"line_number":663,"context_line":"    query \u003d (\"/ws.v1/lswitch/%s/lport?display_name\u003d%s\u0026fields\u003d*\" %"},{"line_number":664,"context_line":"             (lswitch, display_name))"},{"line_number":665,"context_line":"    LOG.debug(_(\"Looking for port with display_name \""},{"line_number":666,"context_line":"                \"\u0027%(display_name)s\u0027 on: %(lswitch)s\"), locals())"},{"line_number":667,"context_line":"    for c in clusters:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAN3%2F%2F%2Bho%3D","line":664,"updated":"2013-03-04 20:20:27.000000000","message":"do we need to do truncation here? Are there other examples of where we search based on a name that may now be truncated?","commit_id":"b7b7cc8f67073dabe2d6c97e87b49b9ea346692a"}],"quantum/tests/unit/nicira/fake_nvpapiclient.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":457,"context_line":"            response_template \u003d f.read()"},{"line_number":458,"context_line":"            add_resource \u003d getattr(self, \u0027_add_%s\u0027 % res_type)"},{"line_number":459,"context_line":"            body_json \u003d json.loads(body)"},{"line_number":460,"context_line":"            self._validators.setdefault(res_type, lambda x: True)(body_json)"},{"line_number":461,"context_line":"            args \u003d [body]"},{"line_number":462,"context_line":"            if len(uuids):"},{"line_number":463,"context_line":"                args.append(uuids[0])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAANH%2F%2F%2FnE%3D","line":460,"updated":"2013-02-28 03:13:26.000000000","message":"Are you intending to add missing defaults to the _validator dict or would a .get() do?","commit_id":"c32b13dd85c1f80b45eb812ef968a70c9b7772bc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":457,"context_line":"            response_template \u003d f.read()"},{"line_number":458,"context_line":"            add_resource \u003d getattr(self, \u0027_add_%s\u0027 % res_type)"},{"line_number":459,"context_line":"            body_json \u003d json.loads(body)"},{"line_number":460,"context_line":"            self._validators.setdefault(res_type, lambda x: True)(body_json)"},{"line_number":461,"context_line":"            args \u003d [body]"},{"line_number":462,"context_line":"            if len(uuids):"},{"line_number":463,"context_line":"                args.append(uuids[0])"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAN3%2F%2F%2F58%3D","line":460,"in_reply_to":"AAAANH%2F%2F%2FnE%3D","updated":"2013-03-03 22:14:28.000000000","message":"The intention was to either invoke the validator or leave the body unaltered.\nThe only reason why I used setDefault was to avoid an if.\n\nA get would have the same effect.","commit_id":"c32b13dd85c1f80b45eb812ef968a70c9b7772bc"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"unresolved":false,"context_lines":[{"line_number":479,"context_line":"                res_type \u003d res_type[:res_type.index(\u0027attachment\u0027)]"},{"line_number":480,"context_line":"            res_dict \u003d getattr(self, \u0027_fake_%s_dict\u0027 % res_type)"},{"line_number":481,"context_line":"            body_json \u003d json.loads(body)"},{"line_number":482,"context_line":"            self._validators.setdefault(res_type, lambda x: True)(body_json)"},{"line_number":483,"context_line":"            resource \u003d res_dict[uuids[-1]]"},{"line_number":484,"context_line":"            if not is_attachment:"},{"line_number":485,"context_line":"                resource.update(body_json)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAANH%2F%2F%2FnA%3D","line":482,"updated":"2013-02-28 03:13:26.000000000","message":"same as above","commit_id":"c32b13dd85c1f80b45eb812ef968a70c9b7772bc"}],"quantum/tests/unit/nicira/test_nicira_plugin.py":[{"author":{"_account_id":447,"name":"dan wendlandt","email":"dan@nicira.com","username":"danwent"},"change_message_id":"b5aba8c90da8fc7b24d8710eafc46289b74b5e95","unresolved":false,"context_lines":[{"line_number":153,"context_line":"                                 data[\u0027port\u0027][\u0027fixed_ips\u0027])"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def test_create_port_name_exceeds_40_chars(self):"},{"line_number":156,"context_line":"        name \u003d \u0027port0123456net0123456net0123456net0123456net0123456\u0027"},{"line_number":157,"context_line":"        with self.port(name\u003dname) as port:"},{"line_number":158,"context_line":"            # Assert the Quantum name is not truncated"},{"line_number":159,"context_line":"            self.assertEqual(name, port[\u0027port\u0027][\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2Bp9s%3D","line":156,"updated":"2013-02-22 17:13:15.000000000","message":"to make it more clear what test you\u0027re doing, perhaps an assert on the exact length of this string would improve readability?","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":153,"context_line":"                                 data[\u0027port\u0027][\u0027fixed_ips\u0027])"},{"line_number":154,"context_line":""},{"line_number":155,"context_line":"    def test_create_port_name_exceeds_40_chars(self):"},{"line_number":156,"context_line":"        name \u003d \u0027port0123456net0123456net0123456net0123456net0123456\u0027"},{"line_number":157,"context_line":"        with self.port(name\u003dname) as port:"},{"line_number":158,"context_line":"            # Assert the Quantum name is not truncated"},{"line_number":159,"context_line":"            self.assertEqual(name, port[\u0027port\u0027][\u0027name\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2BpDw%3D","line":156,"in_reply_to":"AAAAM3%2F%2Bp9s%3D","updated":"2013-02-23 14:15:25.000000000","message":"No. It\u0027s fine as it is now :)\n\nWill do.","commit_id":"783cb4eb340cf039562c39fc4d5f6ec48f3f9fcd"}]}
