)]}'
{"quantum/api/v2/attributes.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e9f7c5af4409301bc0525cc3e05851556b7bbcf8","unresolved":false,"context_lines":[{"line_number":107,"context_line":"        key_err \u003d (any([x not in current_keys for x in expected_keys]) or"},{"line_number":108,"context_line":"                   any([x not in expected_keys for x in current_keys]))"},{"line_number":109,"context_line":"        if key_err:"},{"line_number":110,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %s Provided: %s\") %"},{"line_number":111,"context_line":"                   (expected_keys, current_keys))"},{"line_number":112,"context_line":"            break"},{"line_number":113,"context_line":"        msgs \u003d [_validate_ip_address(ip_pool[x]) for x in expected_keys]"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F%2Bko%3D","line":110,"updated":"2012-11-13 10:07:35.000000000","message":"For localization with multiple arguments in the string it\u0027s better to use named interpolation (%(expected_keys)s) so translators can rearrange the order of the words, if needed for the language.","commit_id":"bed067036efb8ad1bc4132c29770283d753834a2"},{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"331fe99ba0bec58121aee49ccd2c451503761f1a","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return msg"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def _validate_ip_pools(data, valid_values\u003dNone):"},{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2F%2BBY%3D","line":92,"updated":"2012-11-13 18:32:51.000000000","message":"I don\u0027t understand why this method was re-implemented.  The newer implementation no longer fails fast and is more computationally intensive.","commit_id":"82633e35f5b0cfc0609c4863eb757183aa2b095c"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":103,"context_line":"    msg \u003d None"},{"line_number":104,"context_line":"    expected_keys \u003d [\u0027start\u0027, \u0027end\u0027]"},{"line_number":105,"context_line":"    for ip_pool in data:"},{"line_number":106,"context_line":"        if not isinstance(ip_pool, dict):"},{"line_number":107,"context_line":"            msg \u003d _(\"Invalid input. Pool %s must be a dictionary.\") % ip_pool"},{"line_number":108,"context_line":"            break"},{"line_number":109,"context_line":"        provided_keys \u003d ip_pool.keys()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2F93M%3D","line":106,"updated":"2012-11-13 21:23:36.000000000","message":"Since the code has no other reason to throw an exception other than ip_pool not being a dict, I did one check here.","commit_id":"82633e35f5b0cfc0609c4863eb757183aa2b095c"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":108,"context_line":"            break"},{"line_number":109,"context_line":"        provided_keys \u003d ip_pool.keys()"},{"line_number":110,"context_line":"        key_err \u003d (any([x not in provided_keys for x in expected_keys]) or"},{"line_number":111,"context_line":"                   any([x not in expected_keys for x in provided_keys]))"},{"line_number":112,"context_line":"        if key_err:"},{"line_number":113,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":114,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2F93Y%3D","line":111,"updated":"2012-11-13 21:23:36.000000000","message":"This code is much less complicated than casing two lists into sets and comparing them.","commit_id":"82633e35f5b0cfc0609c4863eb757183aa2b095c"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":114,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":115,"context_line":"            break"},{"line_number":116,"context_line":"        msgs \u003d [_validate_ip_address(ip_pool[x]) for x in expected_keys]"},{"line_number":117,"context_line":"        ip_errs \u003d [x for x in msgs if x is not None]"},{"line_number":118,"context_line":"        if ip_errs:"},{"line_number":119,"context_line":"            msg \u003d ip_errs[0]"},{"line_number":120,"context_line":"            break"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAMH%2F%2F93I%3D","line":117,"updated":"2012-11-13 21:23:36.000000000","message":"This part shouldn\u0027t gain that much time efficiency but list comprehension is at least not slower that for loops. This part does two list comprehensions but I think the added overhead is insignificant. Basically I didn\u0027t want to exit two loops here.","commit_id":"82633e35f5b0cfc0609c4863eb757183aa2b095c"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        msgs \u003d [_validate_ip_address(ip_pool[x]) for x in expected_keys]"},{"line_number":115,"context_line":"        ip_errs \u003d [x for x in msgs if x is not None]"},{"line_number":116,"context_line":"        if ip_errs:"},{"line_number":117,"context_line":"            msg \u003d ip_errs[0]"},{"line_number":118,"context_line":"            break"},{"line_number":119,"context_line":"    if msg:"},{"line_number":120,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9o4%3D","line":117,"updated":"2012-11-14 00:54:46.000000000","message":"If both of start and end is invalid, we validated them but report one. I prefer to validate one by one and return earlier.","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":114,"context_line":"        msgs \u003d [_validate_ip_address(ip_pool[x]) for x in expected_keys]"},{"line_number":115,"context_line":"        ip_errs \u003d [x for x in msgs if x is not None]"},{"line_number":116,"context_line":"        if ip_errs:"},{"line_number":117,"context_line":"            msg \u003d ip_errs[0]"},{"line_number":118,"context_line":"            break"},{"line_number":119,"context_line":"    if msg:"},{"line_number":120,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9gE%3D","line":117,"in_reply_to":"AAAAMH%2F%2F9o4%3D","updated":"2012-11-14 02:01:09.000000000","message":"Ok. However I would have to add an extra flag to exit two loops. I\u0027ll fix this and let you take a look","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":195,"context_line":"                msg \u003d _(\"Duplicate hostroute %s\") % hostroute"},{"line_number":196,"context_line":"                break"},{"line_number":197,"context_line":"            hostroutes.append(hostroute)"},{"line_number":198,"context_line":"    except:"},{"line_number":199,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid hostroute\") % data"},{"line_number":200,"context_line":"    if msg:"},{"line_number":201,"context_line":"        LOG.debug(\"validate_hostroutes: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9oQ%3D","line":198,"updated":"2012-11-14 00:54:46.000000000","message":"we removed the try and except before in _validate_ip_pools, how about this one?\nIn addition, \u0027except\u0027 without any Exception type should be avoided.","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":195,"context_line":"                msg \u003d _(\"Duplicate hostroute %s\") % hostroute"},{"line_number":196,"context_line":"                break"},{"line_number":197,"context_line":"            hostroutes.append(hostroute)"},{"line_number":198,"context_line":"    except:"},{"line_number":199,"context_line":"        msg \u003d _(\"\u0027%s\u0027 in not a valid hostroute\") % data"},{"line_number":200,"context_line":"    if msg:"},{"line_number":201,"context_line":"        LOG.debug(\"validate_hostroutes: %s\", msg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9gU%3D","line":198,"in_reply_to":"AAAAMH%2F%2F9oQ%3D","updated":"2012-11-14 02:01:09.000000000","message":"Here it does not check if a key exist or not. Do you prefer removing the try/except?","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    if not isinstance(data, list):"},{"line_number":99,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP pool\") % data"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Zc%3D","line":96,"updated":"2012-11-14 05:18:53.000000000","message":"nit extra \\n","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    if not isinstance(data, list):"},{"line_number":99,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP pool\") % data"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9YU%3D","line":96,"in_reply_to":"AAAAMH%2F%2F9Zc%3D","updated":"2012-11-14 05:35:22.000000000","message":"This was done according to pep257. Do you prefer not having it?","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9ZA%3D","line":114,"updated":"2012-11-14 05:18:53.000000000","message":"nit: consider\n\n        for k in expected_keys:\n            msg \u003d _validate_ip_address(ip_pool[k])\n            if msg:\n                return msg\n        else:\n            break\n    if msg:\n        LOG.debug(\"validate_ip_pools: %s\", msg)\n    return msg\n\nreturning on line 118 removes the extra LOG.Debug we\u0027ll get  about the ip address not being valid.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9U4%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9VM%3D","updated":"2012-11-14 06:43:41.000000000","message":"Ah I see what you are saying you are right.  This was a nit, i don\u0027t think anyone here is offended.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9XM%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9X0%3D","updated":"2012-11-14 05:51:48.000000000","message":"msg \u003d _validate_ip_address(ip_pool[k])\nmsg will be None if the ip_address is valid if it is invalid it will LOG on line 88 and return the msg string. If there is something wrong in the first ip_pool there is no reason to validate the other ones unless you plan to change this to return the fact that multiple addresses are invalid in the pool.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9VM%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9XA%3D","updated":"2012-11-14 06:31:03.000000000","message":"The thing about returning on line 118 is that the admin could think that the error happened during a _validate_ip_address when it actually happend at _validate_ip_pools.\r\n\r\n And what I mean about not validating the other ip_pools is that if the top for loop of the code in your reply exhausts then that means there is no problem with the ips in the first ip_pool.\r\n Then it will not continue to examine the other ip_pools and exit because of the \"else: break\" above \"if msg\".\r\n\r\n If  anyone else agrees with returning on line 118 then I\u0027m ok with it too.\r\n I\u0027m just worried that others be offended by it.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9XA%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9XM%3D","updated":"2012-11-14 05:53:01.000000000","message":"We only return on 118 if there is an invalid address.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9X0%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9YA%3D","updated":"2012-11-14 05:39:47.000000000","message":"The above reply is wrong.\n\nIf we return on line 118 then there will be no log about the invalid IP address and also brings inconsistency of the logical flow.  Using for-else like this will only validate the first ip_pool and exit and not check on the other ip_pools","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":111,"context_line":"            msg \u003d (_(\"Expected keys not found. Expected: %(expected_keys)s \""},{"line_number":112,"context_line":"                     \"Provided: %(provided_keys)s\") % locals())"},{"line_number":113,"context_line":"            break"},{"line_number":114,"context_line":"        ip_err \u003d False"},{"line_number":115,"context_line":"        for k in expected_keys:"},{"line_number":116,"context_line":"            msg \u003d _validate_ip_address(ip_pool[k])"},{"line_number":117,"context_line":"            if msg:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9YA%3D","line":114,"in_reply_to":"AAAAMH%2F%2F9ZA%3D","updated":"2012-11-14 05:35:22.000000000","message":"I can\u0027t quite understand your logic. If we return on line 118 then the ip pool is validated even though one ip address is invalid. Also using for-break like this will only validate the first ip_pool and exit and not check on the other ip_pools","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":118,"context_line":"                ip_err \u003d True"},{"line_number":119,"context_line":"                break"},{"line_number":120,"context_line":"        if ip_err:"},{"line_number":121,"context_line":"            break"},{"line_number":122,"context_line":"    if msg:"},{"line_number":123,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":124,"context_line":"    return msg"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9ZE%3D","line":121,"updated":"2012-11-14 05:10:04.000000000","message":"how about removing ip_err to use msg only?","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"unresolved":false,"context_lines":[{"line_number":118,"context_line":"                ip_err \u003d True"},{"line_number":119,"context_line":"                break"},{"line_number":120,"context_line":"        if ip_err:"},{"line_number":121,"context_line":"            break"},{"line_number":122,"context_line":"    if msg:"},{"line_number":123,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":124,"context_line":"    return msg"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9UY%3D","line":121,"in_reply_to":"AAAAMH%2F%2F9Yk%3D","updated":"2012-11-14 07:05:51.000000000","message":"How about this one:\n\nfor k in expected_keys:\n\n    msg \u003d xxx\n\n    if msg:\n\n       break\n\nif msg:\n\n   break","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":118,"context_line":"                ip_err \u003d True"},{"line_number":119,"context_line":"                break"},{"line_number":120,"context_line":"        if ip_err:"},{"line_number":121,"context_line":"            break"},{"line_number":122,"context_line":"    if msg:"},{"line_number":123,"context_line":"        LOG.debug(\"validate_ip_pools: %s\", msg)"},{"line_number":124,"context_line":"    return msg"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Yk%3D","line":121,"in_reply_to":"AAAAMH%2F%2F9ZE%3D","updated":"2012-11-14 05:16:03.000000000","message":"Then it will continue to the next ip_pool even an ip didn\u0027t pass validation in the first ip_pool","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    msg \u003d None"},{"line_number":134,"context_line":"    ips \u003d []"},{"line_number":135,"context_line":"    for fixed_ip in data:"},{"line_number":136,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":137,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":138,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9e8%3D","line":135,"updated":"2012-11-14 02:50:35.000000000","message":"Does \u0027ip_address\u0027 and \u0027subnet_id\u0027 have to be in a fixed ip dict?\nIf so it would nice to have a \u0027expected_keys\u0027 variable just like _validate_ip_pools.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    msg \u003d None"},{"line_number":134,"context_line":"    ips \u003d []"},{"line_number":135,"context_line":"    for fixed_ip in data:"},{"line_number":136,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":137,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":138,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Yo%3D","line":135,"in_reply_to":"AAAAMH%2F%2F9e8%3D","updated":"2012-11-14 05:18:53.000000000","message":"I believe only the subnet_id has to be there if \u0027ip_address\u0027 is specified  though it seems like  _validate_fixed_ips(data, valid_values\u003dNone): isn\u0027t enforcing that right now.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    msg \u003d None"},{"line_number":134,"context_line":"    ips \u003d []"},{"line_number":135,"context_line":"    for fixed_ip in data:"},{"line_number":136,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":137,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":138,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Y8%3D","line":135,"in_reply_to":"AAAAMH%2F%2F9e8%3D","updated":"2012-11-14 05:10:04.000000000","message":"I think subnet_id must be there. Garyk should be the right person for it.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":187,"context_line":"    msg \u003d None"},{"line_number":188,"context_line":"    hostroutes \u003d []"},{"line_number":189,"context_line":"    try:"},{"line_number":190,"context_line":"        for hostroute in data:"},{"line_number":191,"context_line":"            msg \u003d _validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":192,"context_line":"            if msg:"},{"line_number":193,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9ew%3D","line":190,"updated":"2012-11-14 02:50:35.000000000","message":"Does \u0027destination\u0027 and \u0027nexthop\u0027 have to be in a hostroute dict?\nIf so it would nice to have a \u0027expected_keys\u0027 variable just like _validate_ip_pools.","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":4395,"name":"Aaron Rosen","email":"aaronorosen@gmail.com","username":"arosen"},"change_message_id":"11db4330bba4835a71320d0c28c4e9c5232966df","unresolved":false,"context_lines":[{"line_number":187,"context_line":"    msg \u003d None"},{"line_number":188,"context_line":"    hostroutes \u003d []"},{"line_number":189,"context_line":"    try:"},{"line_number":190,"context_line":"        for hostroute in data:"},{"line_number":191,"context_line":"            msg \u003d _validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":192,"context_line":"            if msg:"},{"line_number":193,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Yc%3D","line":190,"in_reply_to":"AAAAMH%2F%2F9Y0%3D","updated":"2012-11-14 05:18:53.000000000","message":"Looks that way see _validate_hostroutes()","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":187,"context_line":"    msg \u003d None"},{"line_number":188,"context_line":"    hostroutes \u003d []"},{"line_number":189,"context_line":"    try:"},{"line_number":190,"context_line":"        for hostroute in data:"},{"line_number":191,"context_line":"            msg \u003d _validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":192,"context_line":"            if msg:"},{"line_number":193,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAMH%2F%2F9Y0%3D","line":190,"in_reply_to":"AAAAMH%2F%2F9ew%3D","updated":"2012-11-14 05:10:04.000000000","message":"according to the original codes, it seems they must be there. right?","commit_id":"42a5c7640986566aebf441d560f453b0671a51ca"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2012 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7zk%3D","line":2,"updated":"2012-11-15 08:48:43.000000000","message":"Why the new line?","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":1,"context_line":"# vim: tabstop\u003d4 shiftwidth\u003d4 softtabstop\u003d4"},{"line_number":2,"context_line":""},{"line_number":3,"context_line":"# Copyright (c) 2012 OpenStack, LLC."},{"line_number":4,"context_line":"# All Rights Reserved."},{"line_number":5,"context_line":"#"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7yg%3D","line":2,"in_reply_to":"AAAAMH%2F%2F7zk%3D","updated":"2012-11-15 08:58:05.000000000","message":"I don\u0027t know if it\u0027s just me but I saw most of the modules in OpenStack have a blank line between the copyright and vim env string","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return msg"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def _validate_ip_pools(data, valid_values\u003dNone):"},{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7zY%3D","line":92,"updated":"2012-11-15 08:48:43.000000000","message":"I prefer the previous solution. The different error messages had value to the user.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":89,"context_line":"        return msg"},{"line_number":90,"context_line":""},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"def _validate_ip_pools(data, valid_values\u003dNone):"},{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7y4%3D","line":92,"in_reply_to":"AAAAMH%2F%2F7zY%3D","updated":"2012-11-15 08:58:05.000000000","message":"This function works just as the original function. The only difference is that the log message gets printed at one place in every condition.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":93,"context_line":"    \"\"\"Validate that start and end IP addresses are present"},{"line_number":94,"context_line":""},{"line_number":95,"context_line":"    In addition to this the IP addresses will also be validated"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    if not isinstance(data, list):"},{"line_number":99,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP pool\") % data"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F9RQ%3D","line":96,"updated":"2012-11-14 08:22:30.000000000","message":"This additional CR is done according to PEP257.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    msg \u003d None"},{"line_number":132,"context_line":"    ips \u003d []"},{"line_number":133,"context_line":"    for fixed_ip in data:"},{"line_number":134,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":135,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":136,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F9Rc%3D","line":133,"updated":"2012-11-14 08:22:30.000000000","message":"Does \u0027ip_address\u0027 AND \u0027subnet_id\u0027 both have to be present in a fixed ip dict? If so it would be nice to have a \u0027expected_keys\u0027 variable just like _validate_ip_pools.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    msg \u003d None"},{"line_number":132,"context_line":"    ips \u003d []"},{"line_number":133,"context_line":"    for fixed_ip in data:"},{"line_number":134,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":135,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":136,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7y0%3D","line":133,"in_reply_to":"AAAAMH%2F%2F7zo%3D","updated":"2012-11-15 08:58:05.000000000","message":"Then there is no need for more changes needed for this function","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    msg \u003d None"},{"line_number":132,"context_line":"    ips \u003d []"},{"line_number":133,"context_line":"    for fixed_ip in data:"},{"line_number":134,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":135,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":136,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F7zo%3D","line":133,"in_reply_to":"AAAAMH%2F%2F9Rc%3D","updated":"2012-11-15 08:48:43.000000000","message":"No, the following cases are supported:\n1. subnet_id only \u003d\u003e an IP address from the allocation pool(s) for this subnet will be allocated internally)\n2. ip_address only \u003d\u003e validation will take place that this is indeed an IP address on a subnet defined on the logical network.\n3. subnet_id and ip_address \u003d\u003e validation will be done that the ip is on the subnet\nIn the cases the ip_address is passed it will also be checkd that this ip is not allocated.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    msg \u003d None"},{"line_number":132,"context_line":"    ips \u003d []"},{"line_number":133,"context_line":"    for fixed_ip in data:"},{"line_number":134,"context_line":"        if \u0027ip_address\u0027 in fixed_ip:"},{"line_number":135,"context_line":"            # Ensure that duplicate entries are not set - just checking IP"},{"line_number":136,"context_line":"            # suffices. Duplicate subnet_id\u0027s are legitimate."}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F8AE%3D","line":133,"in_reply_to":"AAAAMH%2F%2F9Rc%3D","updated":"2012-11-15 01:29:55.000000000","message":"This I\u0027m still not completely sure.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":185,"context_line":"    msg \u003d None"},{"line_number":186,"context_line":"    hostroutes \u003d []"},{"line_number":187,"context_line":"    try:"},{"line_number":188,"context_line":"        for hostroute in data:"},{"line_number":189,"context_line":"            msg \u003d _validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":190,"context_line":"            if msg:"},{"line_number":191,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F9RY%3D","line":188,"updated":"2012-11-14 08:22:30.000000000","message":"Does \u0027destination\u0027 AND \u0027nexthop\u0027 both have to be present in a hostroute dict? If so it would be nice to have a \u0027expected_keys\u0027 variable just like _validate_ip_pools.","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":185,"context_line":"    msg \u003d None"},{"line_number":186,"context_line":"    hostroutes \u003d []"},{"line_number":187,"context_line":"    try:"},{"line_number":188,"context_line":"        for hostroute in data:"},{"line_number":189,"context_line":"            msg \u003d _validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":190,"context_line":"            if msg:"},{"line_number":191,"context_line":"                break"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAMH%2F%2F8AI%3D","line":188,"in_reply_to":"AAAAMH%2F%2F9RY%3D","updated":"2012-11-15 01:29:55.000000000","message":"I guess it does require both keys according to the try-catch block","commit_id":"b28a2c54067910939fa6df53ca8568fe385533c7"}],"quantum/tests/unit/test_attributes.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"e9f7c5af4409301bc0525cc3e05851556b7bbcf8","unresolved":false,"context_lines":[{"line_number":15,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":16,"context_line":"#    under the License."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"import mock"},{"line_number":19,"context_line":"import unittest2"},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"from quantum.api.v2 import attributes"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAMH%2F%2F%2Bkk%3D","line":18,"updated":"2012-11-13 10:07:35.000000000","message":"this import is no longer used","commit_id":"bed067036efb8ad1bc4132c29770283d753834a2"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_is_attr_set(self):"},{"line_number":27,"context_line":"        data \u003d attributes.ATTR_NOT_SPECIFIED"},{"line_number":28,"context_line":"        self.assertIs(attributes.is_attr_set(data), False)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"        data \u003d None"},{"line_number":31,"context_line":"        self.assertIs(attributes.is_attr_set(data), False)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9l4%3D","line":28,"updated":"2012-11-14 00:54:46.000000000","message":"can we use self.assertTrue and self.assertFalse since we are refactoring the codes?","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":"    def test_is_attr_set(self):"},{"line_number":27,"context_line":"        data \u003d attributes.ATTR_NOT_SPECIFIED"},{"line_number":28,"context_line":"        self.assertIs(attributes.is_attr_set(data), False)"},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"        data \u003d None"},{"line_number":31,"context_line":"        self.assertIs(attributes.is_attr_set(data), False)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9gA%3D","line":28,"in_reply_to":"AAAAMH%2F%2F9l4%3D","updated":"2012-11-14 02:01:09.000000000","message":"assertTrue casts the value to true. Therefore, the assertion could pass when passed integer 1","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":2874,"name":"yong sheng gong","email":"gong.yongsheng@99cloud.net","username":"gongysh"},"change_message_id":"b0c07a6b36c91ed69b052b7c58fd52392fe61c4c","unresolved":false,"context_lines":[{"line_number":181,"context_line":"                       \u0027ip_address\u0027: \u00271.1.1.2\u0027}]]"},{"line_number":182,"context_line":"        for fixed in fixed_ips:"},{"line_number":183,"context_line":"            msg \u003d attributes._validate_fixed_ips(fixed)"},{"line_number":184,"context_line":"            self.assertIsNone(msg)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_validate_nameservers(self):"},{"line_number":187,"context_line":"        ns_pools \u003d [[\u00271.1.1.2\u0027, \u00271.1.1.2\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9lQ%3D","line":184,"updated":"2012-11-14 00:54:46.000000000","message":"How about a group of two fixed_ips with different subnet_id but the same ip?\nIs it valid or invalid?","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"},{"author":{"_account_id":1994,"name":"Zhongyue Luo","email":"zhongyue.luo@gmail.com","username":"zyluo"},"unresolved":false,"context_lines":[{"line_number":181,"context_line":"                       \u0027ip_address\u0027: \u00271.1.1.2\u0027}]]"},{"line_number":182,"context_line":"        for fixed in fixed_ips:"},{"line_number":183,"context_line":"            msg \u003d attributes._validate_fixed_ips(fixed)"},{"line_number":184,"context_line":"            self.assertIsNone(msg)"},{"line_number":185,"context_line":""},{"line_number":186,"context_line":"    def test_validate_nameservers(self):"},{"line_number":187,"context_line":"        ns_pools \u003d [[\u00271.1.1.2\u0027, \u00271.1.1.2\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAMH%2F%2F9f8%3D","line":184,"in_reply_to":"AAAAMH%2F%2F9lQ%3D","updated":"2012-11-14 02:01:09.000000000","message":"this case is handled above in the last case","commit_id":"df7a148268ea831c2933bf7f5944297e6ec16a35"}]}
