)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"fde13e15baea3402172b9cd0dbabba9517989235","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Modify the judgment method of CIDR and Add utests"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The routing table could not add information, because"},{"line_number":10,"context_line":"the original method could not identify the invalidate CIDR."},{"line_number":11,"context_line":"This patch modify the judgement method. It will help"},{"line_number":12,"context_line":"the router working normally."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3f79a3b5_24bde5b2","line":10,"range":{"start_line":10,"start_character":43,"end_line":10,"end_character":54},"updated":"2018-12-26 09:18:06.000000000","message":"-\u003e invalid","commit_id":"1a89027e89d29522b3ace0ace71db904aea16cc2"}],"neutron_lib/api/validators/__init__.py":[{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"24cbbb17dfe10cf8e7edd46a0bf1563a3418cb75","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        msg \u003d _verify_dict_keys(expected_keys, hostroute)"},{"line_number":600,"context_line":"        if msg:"},{"line_number":601,"context_line":"            return msg"},{"line_number":602,"context_line":"        msg \u003d validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":603,"context_line":"        if msg:"},{"line_number":604,"context_line":"            return msg"},{"line_number":605,"context_line":"        msg \u003d validate_ip_address(hostroute[\u0027nexthop\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_8e55a153","side":"PARENT","line":602,"range":{"start_line":602,"start_character":14,"end_line":602,"end_character":29},"updated":"2018-12-07 13:17:30.000000000","message":"Does this mean validate_subnet() as it exists today is not doing the proper thing? What I\u0027m trying to understand is if we should switch all uses to validate_subnet_cidr() or if the existing validate_subnet is still valid for other cases?","commit_id":"26d4f09e80366b10bb1a23e64b80f758cf9875b1"},{"author":{"_account_id":25437,"name":"Allain Legacy","email":"alegacy@redhat.com","username":"alegacy"},"change_message_id":"7c2848a799070f2cf0fd50a68a544124706e038c","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        msg \u003d _verify_dict_keys(expected_keys, hostroute)"},{"line_number":600,"context_line":"        if msg:"},{"line_number":601,"context_line":"            return msg"},{"line_number":602,"context_line":"        msg \u003d validate_subnet(hostroute[\u0027destination\u0027])"},{"line_number":603,"context_line":"        if msg:"},{"line_number":604,"context_line":"            return msg"},{"line_number":605,"context_line":"        msg \u003d validate_ip_address(hostroute[\u0027nexthop\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_ef868fb8","side":"PARENT","line":602,"range":{"start_line":602,"start_character":14,"end_line":602,"end_character":29},"in_reply_to":"3f79a3b5_8e55a153","updated":"2018-12-07 15:32:13.000000000","message":"It is not being used properly here, and it is also not being used properly on the subnet create API.   The subnet create API is allowing invalid input such as 1.2.3.4/24 and then the _create_subnet_precommit in NeutronDbPlubinV2 is silently throwing away the host-bits and storing 1.2.3.0/24 into the database.   In my opinion, that should be changed to report an error at the API.  We do not know if the user incorrectly entered the address or the prefix length so any assumption we make has a 50/50 chance of being incorrect.  For example, if the user entered 1.2.3.4/24 but actually meant 1.2.3.4/30 then by assuming they meant 1.2.3.0/24 we may have introduced a difficult to find error into their network configuration.   Same example applies to the host routes change... the user may have wanted to add a host route for 1.2.3.4/32 but entered 1.2.3.4/24 accidentally which may be getting silently converted to 1.2.3.0/24 by backend drivers.  By allowing ambiguous data to be accepted at the API we are allowing potential network errors to be introduced into the system.  In my opinion, validate_ip_address should be used if the input is truly expected to be a host address, and validate_subnet should be used if the input is expected to be a network address.","commit_id":"26d4f09e80366b10bb1a23e64b80f758cf9875b1"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"36d011b4faa44f193127285678fa747fb1dc58a8","unresolved":false,"context_lines":[{"line_number":599,"context_line":"        msg \u003d _verify_dict_keys(expected_keys, hostroute)"},{"line_number":600,"context_line":"        if msg:"},{"line_number":601,"context_line":"            return msg"},{"line_number":602,"context_line":"        msg \u003d _validate_subnet_cidr(hostroute[\u0027destination\u0027])"},{"line_number":603,"context_line":"        if msg:"},{"line_number":604,"context_line":"            return msg"},{"line_number":605,"context_line":"        msg \u003d validate_ip_address(hostroute[\u0027nexthop\u0027])"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_6be02ccb","line":602,"updated":"2018-12-07 20:26:22.000000000","message":"I think a test case or 2 around here is probably in order https://github.com/openstack/neutron-lib/blob/master/neutron_lib/tests/unit/api/validators/test_validators.py#L531. Specifically, I\u0027m thinking we want coverage on the case where the user passes something like 1.2.3.4/24 (ie a failure case)","commit_id":"9624e105fb6b1f467835a1be84b6813f2a5ca03a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d58bf19b6d4ff6dfeb4c32b9abf9198a8fb5a22b","unresolved":false,"context_lines":[{"line_number":662,"context_line":"    if msg:"},{"line_number":663,"context_line":"        LOG.debug(msg)"},{"line_number":664,"context_line":"    return msg"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"def _validate_subnet_cidr(data):"},{"line_number":667,"context_line":"    msg \u003d None"},{"line_number":668,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_80d1f02f","line":665,"updated":"2018-12-07 11:02:26.000000000","message":"You need two empty lines between functions","commit_id":"9624e105fb6b1f467835a1be84b6813f2a5ca03a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d58bf19b6d4ff6dfeb4c32b9abf9198a8fb5a22b","unresolved":false,"context_lines":[{"line_number":663,"context_line":"        LOG.debug(msg)"},{"line_number":664,"context_line":"    return msg"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"def _validate_subnet_cidr(data):"},{"line_number":667,"context_line":"    msg \u003d None"},{"line_number":668,"context_line":"    try:"},{"line_number":669,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_40c8b874","line":666,"updated":"2018-12-07 11:02:26.000000000","message":"I don\u0027t see any reason to make this function private.","commit_id":"9624e105fb6b1f467835a1be84b6813f2a5ca03a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d58bf19b6d4ff6dfeb4c32b9abf9198a8fb5a22b","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    return msg"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":"def _validate_subnet_cidr(data):"},{"line_number":667,"context_line":"    msg \u003d None"},{"line_number":668,"context_line":"    try:"},{"line_number":669,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":670,"context_line":"        if \u0027/\u0027 not in data or (net.network !\u003d net.ip):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_a0d66c24","line":667,"updated":"2018-12-07 11:02:26.000000000","message":"Can you add a doc string?","commit_id":"9624e105fb6b1f467835a1be84b6813f2a5ca03a"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d58bf19b6d4ff6dfeb4c32b9abf9198a8fb5a22b","unresolved":false,"context_lines":[{"line_number":676,"context_line":"    except Exception:"},{"line_number":677,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP subnet\") % data"},{"line_number":678,"context_line":"    return msg"},{"line_number":679,"context_line":""},{"line_number":680,"context_line":"def validate_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":681,"context_line":"    \"\"\"Validate data is a valid subnet address string or None."},{"line_number":682,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_00e5e007","line":679,"updated":"2018-12-07 11:02:26.000000000","message":"ditto, two empty lines","commit_id":"9624e105fb6b1f467835a1be84b6813f2a5ca03a"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e084773383c7d6699ef6664060f4ecd03700cf96","unresolved":false,"context_lines":[{"line_number":651,"context_line":"    msg \u003d None"},{"line_number":652,"context_line":"    try:"},{"line_number":653,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":654,"context_line":"        if \u0027/\u0027 not in data or (net.version \u003d\u003d 4 and str(net) !\u003d data):"},{"line_number":655,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":656,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":657,"context_line":"                                                     \"cidr\": net.cidr}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_aac7743e","line":654,"range":{"start_line":654,"start_character":31,"end_line":654,"end_character":68},"updated":"2018-12-17 15:52:48.000000000","message":"Hmm, this isn\u0027t making a whole lot of sense to me. Thanks to Liu Yulong for pointing this out, it\u0027s easy to miss things like this in gerrit. I wonder if L678 should just go up here, this check seems strange to me anyway. The fact it seems to only handle IPv4 seems problematic, and I can\u0027t see a situation where str(net) !\u003d data. I think changing this check to what you have at L678 cleans this up AND fixes this bug. I don\u0027t see a need for validate_subnet_cidr, just fix the check here. Am I missing something?","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d6558f860ddae81d358e354fdb2e85a0c6d1d149","unresolved":false,"context_lines":[{"line_number":651,"context_line":"    msg \u003d None"},{"line_number":652,"context_line":"    try:"},{"line_number":653,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":654,"context_line":"        if \u0027/\u0027 not in data or (net.version \u003d\u003d 4 and str(net) !\u003d data):"},{"line_number":655,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":656,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":657,"context_line":"                                                     \"cidr\": net.cidr}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_d8286d9f","line":654,"range":{"start_line":654,"start_character":31,"end_line":654,"end_character":68},"in_reply_to":"3f79a3b5_27738e1d","updated":"2018-12-18 15:41:58.000000000","message":"I forgot about the nonzero_cidr case. Neutron does indeed fix that for you when creating a subnet, so probably want to leave this alone for now. I\u0027m still confused by this check, but I suppose that\u0027s a separate issue.","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":29256,"name":"longqian.zhao","email":"longqian.zhao@intel.com","username":"longqianzhao"},"change_message_id":"2550c71fb655509be55372af4aa8d7ed09ef7e6e","unresolved":false,"context_lines":[{"line_number":651,"context_line":"    msg \u003d None"},{"line_number":652,"context_line":"    try:"},{"line_number":653,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":654,"context_line":"        if \u0027/\u0027 not in data or (net.version \u003d\u003d 4 and str(net) !\u003d data):"},{"line_number":655,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":656,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":657,"context_line":"                                                     \"cidr\": net.cidr}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_27738e1d","line":654,"range":{"start_line":654,"start_character":31,"end_line":654,"end_character":68},"in_reply_to":"3f79a3b5_aac7743e","updated":"2018-12-18 05:51:17.000000000","message":"Some functions about subnet could call validate_subnet to verify the validate IP address, example following two functions:\nneutron.tests.unit.db.test_db_base_plugin_v2.TestSubnetsV2.test_create_subnet_nonzero_cidr\nneutron.tests.unit.db.test_db_base_plugin_v2.TestSubnetPoolsV2.test_allocate_subnet_bad_gateway","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d6558f860ddae81d358e354fdb2e85a0c6d1d149","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    return msg"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"def validate_subnet_cidr(data, valid_values\u003dNone):"},{"line_number":668,"context_line":"    \"\"\"Validate data is an IP network subnet string."},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_18fb4517","line":667,"range":{"start_line":667,"start_character":4,"end_line":667,"end_character":24},"updated":"2018-12-18 15:41:58.000000000","message":"Maybe can rename this to something more clear like validate_route_cidr? I\u0027m just throwing some ideas out there, the point is I think the fact that this is named so similarly to validate_subnet when this has a different purpose could be confusing.","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"baeda2b4167ae690f01bc1260b433e249d94c825","unresolved":false,"context_lines":[{"line_number":664,"context_line":"    return msg"},{"line_number":665,"context_line":""},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"def validate_subnet_cidr(data, valid_values\u003dNone):"},{"line_number":668,"context_line":"    \"\"\"Validate data is an IP network subnet string."},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_c73f1382","line":667,"range":{"start_line":667,"start_character":4,"end_line":667,"end_character":24},"in_reply_to":"3f79a3b5_18fb4517","updated":"2018-12-19 15:27:18.000000000","message":"This `route_cider` function name indeed make sense to me. : )","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"3e64f31cfe0b77f3cbcab3adb76808c657d76fde","unresolved":false,"context_lines":[{"line_number":675,"context_line":"    msg \u003d None"},{"line_number":676,"context_line":"    try:"},{"line_number":677,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":678,"context_line":"        if \u0027/\u0027 not in data or (net.network !\u003d net.ip):"},{"line_number":679,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":680,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":681,"context_line":"                                                     \"cidr\": net.cidr}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_fa8d447e","line":678,"range":{"start_line":678,"start_character":31,"end_line":678,"end_character":52},"updated":"2018-12-17 07:31:32.000000000","message":"So much duplicated code to function `validate_subnet`, DRY :), why not add this condition to Line 654?","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"d6558f860ddae81d358e354fdb2e85a0c6d1d149","unresolved":false,"context_lines":[{"line_number":675,"context_line":"    msg \u003d None"},{"line_number":676,"context_line":"    try:"},{"line_number":677,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":678,"context_line":"        if \u0027/\u0027 not in data or (net.network !\u003d net.ip):"},{"line_number":679,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":680,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":681,"context_line":"                                                     \"cidr\": net.cidr}"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_58577d29","line":678,"range":{"start_line":678,"start_character":31,"end_line":678,"end_character":52},"in_reply_to":"3f79a3b5_fa8d447e","updated":"2018-12-18 15:41:58.000000000","message":"In this case I\u0027m not as concerned about duplicated code per se, even though it does feel strange. I\u0027m more concerned about ensuring it is clear how this all works if someone has to come back to it 6 months or more from now :)","commit_id":"0a18404e909d5e3f90f50ce0e2a787d097be9aa1"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e8df26f865bd8a304c49d406cf94cdcfde755526","unresolved":false,"context_lines":[{"line_number":665,"context_line":""},{"line_number":666,"context_line":""},{"line_number":667,"context_line":"def validate_route_cidr(data, valid_values\u003dNone):"},{"line_number":668,"context_line":"    \"\"\"Validate data is an IP network subnet string."},{"line_number":669,"context_line":""},{"line_number":670,"context_line":"    :param data: The data to validate."},{"line_number":671,"context_line":"    :param valid_values: Not used!"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_2c710e14","line":668,"range":{"start_line":668,"start_character":24,"end_line":668,"end_character":44},"updated":"2018-12-19 15:03:36.000000000","message":"a proper CIDR","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e8df26f865bd8a304c49d406cf94cdcfde755526","unresolved":false,"context_lines":[{"line_number":676,"context_line":"    try:"},{"line_number":677,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":678,"context_line":"        if \u0027/\u0027 not in data or (net.network !\u003d net.ip):"},{"line_number":679,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized IP subnet cidr,\""},{"line_number":680,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":681,"context_line":"                                                     \"cidr\": net.cidr}"},{"line_number":682,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_ac643e4f","line":679,"range":{"start_line":679,"start_character":51,"end_line":679,"end_character":65},"updated":"2018-12-19 15:03:36.000000000","message":"CIDR","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e8df26f865bd8a304c49d406cf94cdcfde755526","unresolved":false,"context_lines":[{"line_number":682,"context_line":"        else:"},{"line_number":683,"context_line":"            return"},{"line_number":684,"context_line":"    except Exception:"},{"line_number":685,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP subnet\") % data"},{"line_number":686,"context_line":"    return msg"},{"line_number":687,"context_line":""},{"line_number":688,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_4c5faa73","line":685,"range":{"start_line":685,"start_character":37,"end_line":685,"end_character":46},"updated":"2018-12-19 15:03:36.000000000","message":"CIDR","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":9531,"name":"liuyulong","display_name":"LIU Yulong","email":"i@liuyulong.me","username":"LIU-Yulong"},"change_message_id":"baeda2b4167ae690f01bc1260b433e249d94c825","unresolved":false,"context_lines":[{"line_number":683,"context_line":"            return"},{"line_number":684,"context_line":"    except Exception:"},{"line_number":685,"context_line":"        msg \u003d _(\"\u0027%s\u0027 is not a valid IP subnet\") % data"},{"line_number":686,"context_line":"    return msg"},{"line_number":687,"context_line":""},{"line_number":688,"context_line":""},{"line_number":689,"context_line":"def validate_subnet_or_none(data, valid_values\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_87b03b2a","line":686,"range":{"start_line":686,"start_character":11,"end_line":686,"end_character":14},"updated":"2018-12-19 15:27:18.000000000","message":"OK, why not add that debug log here like line 662-663?","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac20e0fd8cda2b4596f86bc0c7efb855d70f726f","unresolved":false,"context_lines":[{"line_number":676,"context_line":"    try:"},{"line_number":677,"context_line":"        net \u003d netaddr.IPNetwork(validate_no_whitespace(data))"},{"line_number":678,"context_line":"        if \u0027/\u0027 not in data or (net.network !\u003d net.ip):"},{"line_number":679,"context_line":"            msg \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized CIDR,\""},{"line_number":680,"context_line":"                    \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": data,"},{"line_number":681,"context_line":"                                                     \"cidr\": net.cidr}"},{"line_number":682,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f769fc5_78463024","line":679,"range":{"start_line":679,"start_character":32,"end_line":679,"end_character":37},"updated":"2019-01-02 20:43:08.000000000","message":"nit: s/is not","commit_id":"3ecd7881b5c9fb9e7fa368e094f75c2a151da9da"}],"neutron_lib/tests/unit/api/validators/test_validators.py":[{"author":{"_account_id":29093,"name":"Le, Huifeng","email":"huifeng.le@intel.com","username":"hle"},"change_message_id":"6b75d5b63aa0d4fad22a53e1fc6ed9a99c2f4c7e","unresolved":false,"context_lines":[{"line_number":743,"context_line":"        self._test_validate_subnet(validators.validate_subnet)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_validate_route_cidr(self):"},{"line_number":746,"context_line":"        self._test_validate_route_cidr(validators.validate_subnet_cidr)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_validate_subnet_or_none(self):"},{"line_number":749,"context_line":"        self._test_validate_subnet(validators.validate_subnet_or_none,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_ea7b01ef","line":746,"range":{"start_line":746,"start_character":50,"end_line":746,"end_character":70},"updated":"2018-12-19 06:59:03.000000000","message":"should be validate_route_cidr?","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"e8df26f865bd8a304c49d406cf94cdcfde755526","unresolved":false,"context_lines":[{"line_number":743,"context_line":"        self._test_validate_subnet(validators.validate_subnet)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_validate_route_cidr(self):"},{"line_number":746,"context_line":"        self._test_validate_route_cidr(validators.validate_subnet_cidr)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_validate_subnet_or_none(self):"},{"line_number":749,"context_line":"        self._test_validate_subnet(validators.validate_subnet_or_none,"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f79a3b5_ac4d1ec7","line":746,"range":{"start_line":746,"start_character":50,"end_line":746,"end_character":70},"in_reply_to":"3f79a3b5_ea7b01ef","updated":"2018-12-19 15:03:36.000000000","message":"+1","commit_id":"eaa136f48144e2429bb4f414893839a33666a42b"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"006cda27b85d06d2726dec5d4dc1e74e0dcc9d0f","unresolved":false,"context_lines":[{"line_number":743,"context_line":"        self._test_validate_subnet(validators.validate_subnet)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_validate_route_cidr(self):"},{"line_number":746,"context_line":"        self._test_validate_route_cidr(validators.validate_route_cidr)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_validate_subnet_or_none(self):"},{"line_number":749,"context_line":"        self._test_validate_subnet(validators.validate_subnet_or_none,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_bd2e9558","line":746,"updated":"2018-12-20 10:01:29.000000000","message":"why You need additional method for it? Can\u0027t You just put code from L724-740 here directly?","commit_id":"c3da81362c16b5151fe126a7bd9a0822fc383871"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"12a24b1d30681c38bae9c70a4e956973a1ed8bbc","unresolved":false,"context_lines":[{"line_number":743,"context_line":"        self._test_validate_subnet(validators.validate_subnet)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_validate_route_cidr(self):"},{"line_number":746,"context_line":"        self._test_validate_route_cidr(validators.validate_route_cidr)"},{"line_number":747,"context_line":""},{"line_number":748,"context_line":"    def test_validate_subnet_or_none(self):"},{"line_number":749,"context_line":"        self._test_validate_subnet(validators.validate_subnet_or_none,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_2f247db0","line":746,"in_reply_to":"3f79a3b5_bd2e9558","updated":"2018-12-21 00:05:58.000000000","message":"+1","commit_id":"c3da81362c16b5151fe126a7bd9a0822fc383871"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac20e0fd8cda2b4596f86bc0c7efb855d70f726f","unresolved":false,"context_lines":[{"line_number":737,"context_line":"        # Invalid - CIDR"},{"line_number":738,"context_line":"        cidr \u003d \"192.168.1.1/8\""},{"line_number":739,"context_line":"        msg \u003d validators.validate_route_cidr(cidr, None)"},{"line_number":740,"context_line":"        error \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized CIDR,\""},{"line_number":741,"context_line":"                  \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": cidr,"},{"line_number":742,"context_line":"                                                   \"cidr\": \"192.0.0.0/8\"}"},{"line_number":743,"context_line":"        self.assertEqual(error, msg)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f769fc5_f86320b0","line":740,"range":{"start_line":740,"start_character":30,"end_line":740,"end_character":35},"updated":"2019-01-02 20:43:08.000000000","message":"same here","commit_id":"3ecd7881b5c9fb9e7fa368e094f75c2a151da9da"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ac20e0fd8cda2b4596f86bc0c7efb855d70f726f","unresolved":false,"context_lines":[{"line_number":740,"context_line":"        error \u003d _(\"\u0027%(data)s\u0027 isn\u0027t a recognized CIDR,\""},{"line_number":741,"context_line":"                  \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": cidr,"},{"line_number":742,"context_line":"                                                   \"cidr\": \"192.0.0.0/8\"}"},{"line_number":743,"context_line":"        self.assertEqual(error, msg)"},{"line_number":744,"context_line":""},{"line_number":745,"context_line":"    def test_validate_subnet_or_none(self):"},{"line_number":746,"context_line":"        self._test_validate_subnet(validators.validate_subnet_or_none,"}],"source_content_type":"text/x-python","patch_set":16,"id":"1f769fc5_58749468","line":743,"updated":"2019-01-02 20:43:08.000000000","message":"There is no test for the exception case","commit_id":"3ecd7881b5c9fb9e7fa368e094f75c2a151da9da"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":726,"context_line":"    def test_validate_route_cidr(self):"},{"line_number":727,"context_line":"        # Valid - CIDR"},{"line_number":728,"context_line":"        cidr \u003d \"10.0.0.0/8\""},{"line_number":729,"context_line":"        msg \u003d validators.validate_route_cidr(cidr, None)"},{"line_number":730,"context_line":"        self.assertIsNone(msg)"},{"line_number":731,"context_line":""},{"line_number":732,"context_line":"        # Valid - CIDR"}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_2c98cf68","line":729,"range":{"start_line":729,"start_character":51,"end_line":729,"end_character":55},"updated":"2019-01-03 09:38:32.000000000","message":"You don\u0027t need to pass this argument as it is set to None by default","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":731,"context_line":""},{"line_number":732,"context_line":"        # Valid - CIDR"},{"line_number":733,"context_line":"        cidr \u003d \"192.168.1.1/32\""},{"line_number":734,"context_line":"        msg \u003d validators.validate_route_cidr(cidr, None)"},{"line_number":735,"context_line":"        self.assertIsNone(msg)"},{"line_number":736,"context_line":""},{"line_number":737,"context_line":"        # Invalid - CIDR"}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_4c9d1358","line":734,"range":{"start_line":734,"start_character":51,"end_line":734,"end_character":55},"updated":"2019-01-03 09:38:32.000000000","message":"You don\u0027t need to pass this argument as it is set to None by default","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":736,"context_line":""},{"line_number":737,"context_line":"        # Invalid - CIDR"},{"line_number":738,"context_line":"        cidr \u003d \"192.168.1.1/8\""},{"line_number":739,"context_line":"        msg \u003d validators.validate_route_cidr(cidr, None)"},{"line_number":740,"context_line":"        error \u003d _(\"\u0027%(data)s\u0027 is not a recognized CIDR,\""},{"line_number":741,"context_line":"                  \" \u0027%(cidr)s\u0027 is recommended\") % {\"data\": cidr,"},{"line_number":742,"context_line":"                                                   \"cidr\": \"192.0.0.0/8\"}"}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_eca16797","line":739,"range":{"start_line":739,"start_character":51,"end_line":739,"end_character":55},"updated":"2019-01-03 09:38:32.000000000","message":"You don\u0027t need to pass this argument as it is set to None by default","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":744,"context_line":""},{"line_number":745,"context_line":"        # Invalid - CIDR format error"},{"line_number":746,"context_line":"        cidr \u003d \u0027invalid\u0027"},{"line_number":747,"context_line":"        msg \u003d validators.validate_route_cidr(cidr,None)"},{"line_number":748,"context_line":"        error \u003d \"\u0027%s\u0027 is not a valid CIDR\" % cidr"},{"line_number":749,"context_line":"        self.assertEqual(error, msg)"},{"line_number":750,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_ac9d9f67","line":747,"range":{"start_line":747,"start_character":45,"end_line":747,"end_character":54},"updated":"2019-01-03 09:38:32.000000000","message":"nit: please add space after comma,\nalso You don\u0027t need to pass this argument as it is set to None by default","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":749,"context_line":"        self.assertEqual(error, msg)"},{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        cidr \u003d None"},{"line_number":752,"context_line":"        msg \u003d validators.validate_route_cidr(cidr,None)"},{"line_number":753,"context_line":"        if allow_none:"},{"line_number":754,"context_line":"            self.assertIsNone(msg)"},{"line_number":755,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_6c89f724","line":752,"range":{"start_line":752,"start_character":45,"end_line":752,"end_character":54},"updated":"2019-01-03 09:38:32.000000000","message":"ditto","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"8e2e645915627ab4457f7479430fd3e0a41e6539","unresolved":false,"context_lines":[{"line_number":750,"context_line":""},{"line_number":751,"context_line":"        cidr \u003d None"},{"line_number":752,"context_line":"        msg \u003d validators.validate_route_cidr(cidr,None)"},{"line_number":753,"context_line":"        if allow_none:"},{"line_number":754,"context_line":"            self.assertIsNone(msg)"},{"line_number":755,"context_line":"        else:"},{"line_number":756,"context_line":"            error \u003d \"\u0027%s\u0027 is not a valid CIDR\" % cidr"}],"source_content_type":"text/x-python","patch_set":19,"id":"ffd0ebdf_cc73434d","line":753,"range":{"start_line":753,"start_character":11,"end_line":753,"end_character":21},"updated":"2019-01-03 09:38:32.000000000","message":"Yo don\u0027t have specified this variable anywhere","commit_id":"d3f886f1ec1e84bfa58d1aad1e9d6bfb7f4cc478"}],"releasenotes/notes/add-validate-cidr-848c9171dcbcf57c.yaml":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"baf86a05eca9474c9af3489db899523bff2fa3bf","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Add method \"validate_subnet_cidr\" in \"neutron_lib.api.validators\"."},{"line_number":5,"context_line":"    This patch can be used to verify the validate CIDR. It will"},{"line_number":6,"context_line":"    help the router working normally."}],"source_content_type":"text/x-yaml","patch_set":5,"id":"3f79a3b5_1f406833","line":6,"range":{"start_line":5,"start_character":56,"end_line":6,"end_character":37},"updated":"2018-12-13 08:25:34.000000000","message":"I\u0027m not sure if that is good sentence for release note :) So until now router worked how? Not normally? What that means for user?","commit_id":"7775be0fc5aa0d84dc853ec6ef55e129d61840fb"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"006cda27b85d06d2726dec5d4dc1e74e0dcc9d0f","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This patch can be used to validate the CIDR parameter to avoid"},{"line_number":5,"context_line":"    invalid input (such as 10.0.0.5/24) being applied to router\u0027s"},{"line_number":6,"context_line":"    routes or subnet\u0027s host_routes attribute."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"3f79a3b5_fd608da1","line":6,"updated":"2018-12-20 10:01:29.000000000","message":"I\u0027m not English speaker but this note sounds a bit strange for me. I would say maybe something like:\n\n\"Introduce new validator ``validate_route_cidr`` which is used to validate if router\u0027s host_routes attribute is valid CIDR.\"\n\nor something similar.","commit_id":"c3da81362c16b5151fe126a7bd9a0822fc383871"},{"author":{"_account_id":4187,"name":"Ryan Tidwell","email":"rtidwell@suse.com","username":"ryan-tidwell"},"change_message_id":"12a24b1d30681c38bae9c70a4e956973a1ed8bbc","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This patch can be used to validate the CIDR parameter to avoid"},{"line_number":5,"context_line":"    invalid input (such as 10.0.0.5/24) being applied to router\u0027s"},{"line_number":6,"context_line":"    routes or subnet\u0027s host_routes attribute."}],"source_content_type":"text/x-yaml","patch_set":10,"id":"3f79a3b5_4cfc670d","line":6,"in_reply_to":"3f79a3b5_fd608da1","updated":"2018-12-21 00:05:58.000000000","message":"+1, and pretty good suggestion for a non-native English speaker, not sure I could have done better myself :)","commit_id":"c3da81362c16b5151fe126a7bd9a0822fc383871"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"b494678b31fe0bcd0b604601cfc65b7a0256c6b2","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This patch create new function named \"validate_route_cidr\""},{"line_number":5,"context_line":"    which is used to validate if router\u0027s host_routes"},{"line_number":6,"context_line":"    attribute is validate CIDR."}],"source_content_type":"text/x-yaml","patch_set":12,"id":"3f79a3b5_46019eb3","line":4,"range":{"start_line":4,"start_character":41,"end_line":4,"end_character":42},"updated":"2018-12-21 07:44:09.000000000","message":"please use `` instead of \" in release notes","commit_id":"dcd6b6f097136ecbf60cdc6e7354758d943aa1c5"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2a16a5cffb6c7871f608c476e1e238764dbcd785","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This patch creates a new function named ``validate_route_cidr``"},{"line_number":5,"context_line":"    which is used to validate if router\u0027s host_routes"},{"line_number":6,"context_line":"    attribute is validate CIDR."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"1f769fc5_a60d9d3f","line":4,"range":{"start_line":4,"start_character":4,"end_line":4,"end_character":14},"updated":"2019-01-02 01:31:35.000000000","message":"After rendered, \"This patch\" cannot be understood. For example,\n\n A new function named validate_router_cidr was introduced ....","commit_id":"da95bc3fdca79a227b272fdddf36f5021147b41a"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"2a16a5cffb6c7871f608c476e1e238764dbcd785","unresolved":false,"context_lines":[{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    This patch creates a new function named ``validate_route_cidr``"},{"line_number":5,"context_line":"    which is used to validate if router\u0027s host_routes"},{"line_number":6,"context_line":"    attribute is validate CIDR."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"1f769fc5_c60a1925","line":6,"range":{"start_line":6,"start_character":17,"end_line":6,"end_character":30},"updated":"2019-01-02 01:31:35.000000000","message":"The following points need to be improved. Some of them might be beyond the scope of neutron-lib release notes and they might be better to be a part of the neutron release note because it affect end users. If so, it should be covered by a patch which bumps neutron-lib requirements in neutron.\n\n- This function denies a CIDR notation like 192.168.1.10/24 but this is a valid CIDR notation, so \"validate CIDR\" is incorrect. I think more correct description is to validate if \"destination\" of \"routes\" is a network address of a destination subnet or an IP address of a destination.\n- This function is for \"destination\" of host_routes.\n- The \"router\" resource has no \"host_routes\". The correct attribute name is \"routes\".\n- This validator is also used for \"host_routes\" attribute of \"subnet\" resource. This needs to be mentioned.","commit_id":"da95bc3fdca79a227b272fdddf36f5021147b41a"}],"releasenotes/notes/cidr_for_canonical_format-4e7925d76a27a19d.yaml":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"d263a3cb09e3b477419eb7c0c29e77842f51fa1e","unresolved":false,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    A new converter is added to facilitate converting IPv6 CIDRs to canonical format. This way"},{"line_number":5,"context_line":"    IPv6 CIDRs can be specified in multiple formats but would be handled in their canonical format."}],"source_content_type":"text/x-yaml","patch_set":4,"id":"3f79a3b5_eba887d7","side":"PARENT","line":5,"updated":"2018-12-11 09:40:23.000000000","message":"We use pep8 to check the code style. The line char limit is 80.","commit_id":"26d4f09e80366b10bb1a23e64b80f758cf9875b1"}]}
