)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"99f1bc240b259c152d764c6affe1065a25dcd4c4","unresolved":false,"context_lines":[{"line_number":14,"context_line":"separate change."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I8dcf49adc7754d0c9aa0479ede2de481325bb3e3"},{"line_number":17,"context_line":"Needed-By: I7b4108772e8370e8f51971caf40ecd23e9f977e9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a71b18c_4e88d471","line":17,"updated":"2016-12-09 23:40:41.000000000","message":"for patches in the same repo, please refrain from using Needed-by/Depends-on. It screws up the ability for git to figure the right thing to do.","commit_id":"dcd1e11545119de80c7f8d3238a5bca401059bcd"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"d3be7b5531d6505ac1cdaf2681a6ad57ab05d94c","unresolved":false,"context_lines":[{"line_number":14,"context_line":"separate change."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Change-Id: I8dcf49adc7754d0c9aa0479ede2de481325bb3e3"},{"line_number":17,"context_line":"Needed-By: I7b4108772e8370e8f51971caf40ecd23e9f977e9"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"1a6eadb0_1da56eb4","line":17,"in_reply_to":"3a71b18c_4e88d471","updated":"2016-12-14 16:40:05.000000000","message":"removed.","commit_id":"dcd1e11545119de80c7f8d3238a5bca401059bcd"}],"neutron_lib/api/validators.py":[{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"32981acd2e4249603d6a2cfeeb04af7edd6f5200","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_141029a8","line":543,"range":{"start_line":543,"start_character":4,"end_line":543,"end_character":33},"updated":"2016-12-07 15:38:19.000000000","message":"I\u0027m questioning if we really need this given we already have validate_subnet_or_none() and validate_ip_address_or_none(); can\u0027t consumers just use those and potentially chain them if needed?","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"32981acd2e4249603d6a2cfeeb04af7edd6f5200","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_f481edc4","line":543,"range":{"start_line":543,"start_character":40,"end_line":543,"end_character":52},"updated":"2016-12-07 15:38:19.000000000","message":"If valid_values isn\u0027t used, IMO we should just remove it from the signature.","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"1a5a1902b71b86612eee7ad9a692701ab9eec5c4","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_9e969d4a","line":543,"range":{"start_line":543,"start_character":4,"end_line":543,"end_character":33},"in_reply_to":"3a71b18c_141029a8","updated":"2016-12-09 22:27:38.000000000","message":"Since this is consumed in RESOURCE_ATTRIBUTE_MAP, it seems unlikely that chaining is possible.  At least, I was not able to get it to work.  Could you give it a try?","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da4f063c1ac89da94a7d8d88dcc80b5c4d1e6d1f","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_6b3822ef","line":543,"range":{"start_line":543,"start_character":4,"end_line":543,"end_character":33},"in_reply_to":"3a71b18c_9e969d4a","updated":"2016-12-09 23:33:36.000000000","message":"I think what boden meant was to perhaps leverage validate_subnet_or_none directly from this validator. But I am more curious to learn what invalid input will be caught by this that won\u0027t be caught by validate_subnet_or_none.","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"da4f063c1ac89da94a7d8d88dcc80b5c4d1e6d1f","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_ab5f9a3f","line":543,"range":{"start_line":543,"start_character":40,"end_line":543,"end_character":52},"in_reply_to":"3a71b18c_f481edc4","updated":"2016-12-09 23:33:36.000000000","message":"@boden: we can\u0027t remove it from the signature unless we make neutron\u0027s consumer able to handle both signatures in [1], as right now we\u0027re passing both data and valid_values. Before dropping valid values where it\u0027s not used we need to adapt the caller.\n\n[1] https://github.com/openstack/neutron/blob/master/neutron/api/v2/attributes.py#L332","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"1a5a1902b71b86612eee7ad9a692701ab9eec5c4","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":1,"id":"3a71b18c_be00b935","line":543,"range":{"start_line":543,"start_character":40,"end_line":543,"end_character":52},"in_reply_to":"3a71b18c_f481edc4","updated":"2016-12-09 22:27:38.000000000","message":"I will if you insist, but please note that it validates the pattern.  All of the other validators include a second argument; most of them call it valid_values, and seventeen times is the exact text \n\n    :param valid_values: Not used!\n\nrepeated in this file.  I would not like to deviate from the pattern without a strong reason for doing so.","commit_id":"a5273590aa1bb937d7e9bb0d30798c7dc577b79e"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"7972e5bf563a55f049d41714c5e0591e2e5e8a7b","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is invalid."},{"line_number":550,"context_line":"    \"\"\""},{"line_number":551,"context_line":"    if data is None:"},{"line_number":552,"context_line":"        return None"},{"line_number":553,"context_line":"    msg_ip \u003d validate_ip_address(data, valid_values)"},{"line_number":554,"context_line":"    if not msg_ip:"},{"line_number":555,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a71b18c_2e9c78bf","line":552,"updated":"2016-12-09 23:39:51.000000000","message":"return None is redundant. return would suffice, however I think this can be as simple as:\n\n    if data is not None:\n      return validate_subnet_or_none(data) or validate_ip_address_or_none(data)","commit_id":"dcd1e11545119de80c7f8d3238a5bca401059bcd"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"d3be7b5531d6505ac1cdaf2681a6ad57ab05d94c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is invalid."},{"line_number":550,"context_line":"    \"\"\""},{"line_number":551,"context_line":"    if data is None:"},{"line_number":552,"context_line":"        return None"},{"line_number":553,"context_line":"    msg_ip \u003d validate_ip_address(data, valid_values)"},{"line_number":554,"context_line":"    if not msg_ip:"},{"line_number":555,"context_line":"        return"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a6eadb0_9d641ee6","line":552,"in_reply_to":"3a71b18c_2e9c78bf","updated":"2016-12-14 16:40:05.000000000","message":"Sure thing","commit_id":"dcd1e11545119de80c7f8d3238a5bca401059bcd"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"3e48a95076205191c50755c3289ec8ffde2f74ed","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"},{"line_number":556,"context_line":"            return _(\"%(msg_ip)s and %(msg_subnet)s\") % {\u0027msg_ip\u0027: msg_ip,"},{"line_number":557,"context_line":"                                                         \u0027msg_subnet\u0027:"},{"line_number":558,"context_line":"                                                         msg_subnet}"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_06789629","line":556,"range":{"start_line":556,"start_character":22,"end_line":556,"end_character":51},"updated":"2016-12-14 16:16:42.000000000","message":"The output message seems repetitive, shouldn\u0027t be better to return a new message ignoring the output of the validators.\n\nFor example :\n\n\"\u0027300.0.0.1\u0027 is not a valid IP address and subnet\"\n\ninstead of :\n\n\n\"\u0027300.0.0.1\u0027 is not a valid IP address and \u0027300.0.0.1\u0027 is not a valid IP subnet\"","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"97ba338e226c466a00c1330f6dc873d42fb92d52","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"},{"line_number":556,"context_line":"            return _(\"%(msg_ip)s and %(msg_subnet)s\") % {\u0027msg_ip\u0027: msg_ip,"},{"line_number":557,"context_line":"                                                         \u0027msg_subnet\u0027:"},{"line_number":558,"context_line":"                                                         msg_subnet}"},{"line_number":559,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_bad292fe","line":556,"range":{"start_line":556,"start_character":22,"end_line":556,"end_character":51},"in_reply_to":"1a6eadb0_06789629","updated":"2016-12-14 16:32:35.000000000","message":"Done","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f7035eb38285251c825f7e761e119d0e02895791","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_35475e4c","line":543,"updated":"2016-12-15 02:23:08.000000000","message":"super mega nit: I would have expected this to be located after method on line 584, but no big deal","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"4f702d8bc0fb22975cd89112a0a3aefb3fe4797e","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_82cd5fb9","line":552,"updated":"2016-12-14 23:06:26.000000000","message":"Couldn\u0027t we just simplify all this and just have::\n\n   return validate_ip_address_or_none(data, valid_values\u003dvalid_values) or validate_subnet_or_none(data, valid_values\u003dvalid_values)\n\n\nThe above should return the 1st validation failure or None if both functions validate successfully.","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"cdd70d6a85081659f17c5f154969e7c499820cfa","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_753e368d","line":552,"range":{"start_line":552,"start_character":4,"end_line":552,"end_character":23},"updated":"2016-12-15 02:26:06.000000000","message":"with the _or_none below is this conditional necessary? My brain is all mushy recently.","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"17a35d58f686c504c4718853841150c4a2c46022","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_b87fe364","line":552,"range":{"start_line":552,"start_character":4,"end_line":552,"end_character":23},"in_reply_to":"1a6eadb0_753e368d","updated":"2016-12-15 03:06:21.000000000","message":"Good point.  Removed.","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"599dc90bb1d2d6fe4f31b80b36d4f264f8d0e4d7","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_d1247fc6","line":552,"in_reply_to":"1a6eadb0_800ab777","updated":"2016-12-15 02:18:59.000000000","message":"Ok, I learned something new, but I expected a valid IP address not to be a valid subnet (with cidr I mean), but you\u0027re saying that it is so in order for the conditional on line 555 to be False and thus return None, which means \u0027Valid Input\u0027.\n\nI am looking at the test and the implementation of validate_subnet_or_none and I expected something else!","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"89168967a3fb1e23aee2984a42ace3d2ab46a2d4","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_800ab777","line":552,"in_reply_to":"1a6eadb0_82cd5fb9","updated":"2016-12-15 00:22:29.000000000","message":"Unfortunately, the suggested behavior is suboptimal in two ways.\n\nFirst, data will never pass both validations. An IP address like 8.8.8.8 will never pass validation as a valid subnet; a subnet like 192.168.0.0/16 will never pass validation as a valid IP address. \n\nSecond, if we were to take the first invalid validation response, we would be misleading the consumer. Any response to the consumer should note that either an IP address or a subnet is valid input. For example, let\u0027s say that a consumer inputs subnet 4.3.2.1/78; this is not a valid subnet, but the response would be that the input was not a valid IP address, leading the consumer to believe that subnet input is never acceptable.","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"9b845c2e28e4db12468ba9b53c53696112a68fb7","unresolved":false,"context_lines":[{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."},{"line_number":551,"context_line":"    \"\"\""},{"line_number":552,"context_line":"    if data is not None:"},{"line_number":553,"context_line":"        msg_ip \u003d validate_ip_address_or_none(data)"},{"line_number":554,"context_line":"        msg_subnet \u003d validate_subnet_or_none(data)"},{"line_number":555,"context_line":"        if msg_ip is not None and msg_subnet is not None:"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_b57fee64","line":552,"in_reply_to":"1a6eadb0_d1247fc6","updated":"2016-12-15 02:24:01.000000000","message":"doh, never mind, I read the conditional wrong...","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"972b53928da2ea677a4a00d8a8d959bd75fd9806","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_02a3e6b2","line":543,"updated":"2016-12-15 16:19:33.000000000","message":"what\u0027s the type for this validator? We could add it statically to line 899.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"198b7c5d26d40a0ac05e3e9a5d637361a4bda6b4","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_a2da32e6","line":543,"in_reply_to":"1a6eadb0_02a3e6b2","updated":"2016-12-15 16:28:02.000000000","message":"The type is `ip_or_subnet_or_none`, for example at https://review.openstack.org/#/c/389388/16/neutron_lib/api/definitions/firewall_v2.py@89\n\nI\u0027ll add it statically.  I was reluctant to do that - I figured, you added add_validator for a reason - but since you seem cool with adding it statically that makes life easier.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"58665535ef664c3a744578ff6a93dff0eed6293d","unresolved":false,"context_lines":[{"line_number":540,"context_line":"        return validate_ip_address(data, valid_values)"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":""},{"line_number":543,"context_line":"def validate_ip_or_subnet_or_none(data, valid_values\u003dNone):"},{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_9a34a94a","line":543,"in_reply_to":"1a6eadb0_a2da32e6","updated":"2016-12-16 01:15:53.000000000","message":"add_validator was added back when we needed something clean to insert validators when extensions were defined out of tree and it is still the clean way of doing so for extensions that are not part of the lib definition set.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"4b56f843009ce89ea1bb9b01dc2e7f0c65e500b3","unresolved":false,"context_lines":[{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."},{"line_number":547,"context_line":"    :param valid_values: Not used!"},{"line_number":548,"context_line":"    :return: None if data is None or a valid IP address or a valid IP subnet,"},{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_1a743066","line":547,"range":{"start_line":547,"start_character":4,"end_line":547,"end_character":34},"updated":"2016-12-15 14:57:09.000000000","message":"And this continues to irk me, tho nothing related to this patch.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"f3feb6649241a6b8f0b2cc8065bd2c0772df60da","unresolved":false,"context_lines":[{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."},{"line_number":547,"context_line":"    :param valid_values: Not used!"},{"line_number":548,"context_line":"    :return: None if data is None or a valid IP address or a valid IP subnet,"},{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_4224fe5e","line":547,"range":{"start_line":547,"start_character":4,"end_line":547,"end_character":34},"in_reply_to":"1a6eadb0_1a743066","updated":"2016-12-15 16:18:23.000000000","message":"Any reason that prevent you from fixing it? I think we can definitely drop it if we can make neutron able to deal with valid_values and valid_values-less validators!!","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"cd94fa95e75328010b1b2a85d4dad1f1d85eddbc","unresolved":false,"context_lines":[{"line_number":544,"context_line":"    \"\"\"Validate data is an IP address, a valid IP subnet string, or None."},{"line_number":545,"context_line":""},{"line_number":546,"context_line":"    :param data: The data to validate."},{"line_number":547,"context_line":"    :param valid_values: Not used!"},{"line_number":548,"context_line":"    :return: None if data is None or a valid IP address or a valid IP subnet,"},{"line_number":549,"context_line":"    otherwise a human readable message indicating why the data is neither an"},{"line_number":550,"context_line":"    IP address nor IP subnet."}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_0c064720","line":547,"range":{"start_line":547,"start_character":4,"end_line":547,"end_character":34},"in_reply_to":"1a6eadb0_4224fe5e","updated":"2016-12-19 14:09:56.000000000","message":"Technically you prevented me from fixing it [1] ;)\n\n\nI\u0027ll revisit this topic when time permits; as we discussed before ([1]) this is low priority when compared to rehoming neutron code to lib.\n\n\n[1] https://review.openstack.org/#/c/390398/","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"}],"neutron_lib/tests/unit/api/test_validators.py":[{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"3e48a95076205191c50755c3289ec8ffde2f74ed","unresolved":false,"context_lines":[{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"    def test_validate_ipv4(self):"},{"line_number":1037,"context_line":"        testdata \u003d \"172.0.0.1\""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_66514a0e","line":1034,"range":{"start_line":1034,"start_character":26,"end_line":1034,"end_character":72},"updated":"2016-12-14 16:16:42.000000000","message":"I was thinking in the case scenario for this validation, but it doesn\u0027t make sense.\n\nsubnet \u003d None\nvalidators.validate_ip_or_subnet_or_none(subnet)\n\nis a valid subnet or ip?","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"bd31250f997e43af7e1575fb24705be4eaa15747","unresolved":false,"context_lines":[{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"    def test_validate_ipv4(self):"},{"line_number":1037,"context_line":"        testdata \u003d \"172.0.0.1\""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_cf76a0d6","line":1034,"range":{"start_line":1034,"start_character":26,"end_line":1034,"end_character":72},"in_reply_to":"1a6eadb0_0ce1869a","updated":"2016-12-14 22:58:10.000000000","message":"I believe None is valid input.  There are many validators in the file that accept None as valid input - I am not sure, but I think it is a majority of them.  \n\n    ~/neutron-lib$ grep _or_none neutron_lib/api/validators.py | egrep \u0027^def|type:\u0027\n    def validate_not_empty_string_or_none(data, max_len\u003dNone):\n    def validate_string_or_none(data, max_len\u003dNone):\n    def validate_mac_address_or_none(data, valid_values\u003dNone):\n    def validate_ip_address_or_none(data, valid_values\u003dNone):\n    def validate_subnet_or_none(data, valid_values\u003dNone):\n    def validate_regex_or_none(data, valid_values\u003dNone):\n    def validate_subnetpool_id_or_none(data, valid_values\u003dNone):\n    def validate_uuid_or_none(data, valid_values\u003dNone):\n    def validate_dict_or_none(data, key_specs\u003dNone):\n              \u0027type:dict_or_none\u0027: validate_dict_or_none,\n              \u0027type:ip_address_or_none\u0027: validate_ip_address_or_none,\n              \u0027type:mac_address_or_none\u0027: validate_mac_address_or_none,\n              \u0027type:regex_or_none\u0027: validate_regex_or_none,\n              \u0027type:string_or_none\u0027: validate_string_or_none,\n              \u0027type:not_empty_string_or_none\u0027:\n              \u0027type:subnet_or_none\u0027: validate_subnet_or_none,\n              \u0027type:subnetpool_id_or_none\u0027: validate_subnetpool_id_or_none,\n              \u0027type:uuid_or_none\u0027: validate_uuid_or_none,\n\nWhat is the difference between a validator that accepts None as valid input and one that does not, like validate_boolean?  That is not known to me.  But I feel like I am on firm ground since the two functions that validate_ip_or_subnet_or_none pulls from - validate_ip_address_or_none and validate_subnet_or_none - both accept None as valid input.  Therefore of necessity validate_ip_or_subnet_or_none should also accept None as valid input.","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"97ba338e226c466a00c1330f6dc873d42fb92d52","unresolved":false,"context_lines":[{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"    def test_validate_ipv4(self):"},{"line_number":1037,"context_line":"        testdata \u003d \"172.0.0.1\""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_7aac7aa0","line":1034,"range":{"start_line":1034,"start_character":26,"end_line":1034,"end_character":72},"in_reply_to":"1a6eadb0_66514a0e","updated":"2016-12-14 16:32:35.000000000","message":"I\u0027m not sure I follow.  I think you are asking why \u0027None\u0027 is a valid input.  I believe \u0027None\u0027 is what you get if the parameter being validated by validate_ip_or_subnet_or_none is not specified.  That is my impression, at least.\n\nIf I understood your concern incorrectly, could you explain your comment further?","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"342a773977eaa36038523b0781bb54b49273ea3a","unresolved":false,"context_lines":[{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"},{"line_number":1035,"context_line":""},{"line_number":1036,"context_line":"    def test_validate_ipv4(self):"},{"line_number":1037,"context_line":"        testdata \u003d \"172.0.0.1\""}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_0ce1869a","line":1034,"range":{"start_line":1034,"start_character":26,"end_line":1034,"end_character":72},"in_reply_to":"1a6eadb0_7aac7aa0","updated":"2016-12-14 22:25:35.000000000","message":"Yes, my point is from the way that this implementation has been written None could be considered as valid IP or Subnet, because it\u0027s not returning a message, which I think that it\u0027s not the desire case right?","commit_id":"13822cb2b05c5046e5de034c4386188cc510cd9a"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"4b56f843009ce89ea1bb9b01dc2e7f0c65e500b3","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"        self.assertIsNone(validators.validate_subports(body))"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_3a6c8c34","line":1031,"updated":"2016-12-15 14:57:09.000000000","message":"Do you really think we need all these new tests given this new validator is so simple and calls 2 already tested validators? \n\n\nWhat if we just made sure it calls validate_ip_address_or_none and validate_subnet_or_none as well as ensuring the invalid data case; wouldn\u0027t that provide the coverage we need?\n\n\nNot trying to nit this to death, just seems like we have some redundant testing here.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":13995,"name":"Nate Johnston","email":"nate.johnston@redhat.com","username":"natejohnston"},"change_message_id":"198b7c5d26d40a0ac05e3e9a5d637361a4bda6b4","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"        self.assertIsNone(validators.validate_subports(body))"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_ad1b0372","line":1031,"in_reply_to":"1a6eadb0_3a6c8c34","updated":"2016-12-15 16:28:02.000000000","message":"Yes, we could just make sure the underlying functions are called, I just thought this was more thorough and clear.  From your comment I\u0027m not sure if you feel strongly about this, if you really object then I\u0027ll change it.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"},{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"5e9589fb250539077e3aefd2b1d3035423ca52f0","unresolved":false,"context_lines":[{"line_number":1028,"context_line":"        self.assertIsNone(validators.validate_subports(body))"},{"line_number":1029,"context_line":""},{"line_number":1030,"context_line":""},{"line_number":1031,"context_line":"class TestValidateIPSubnetNone(base.BaseTestCase):"},{"line_number":1032,"context_line":""},{"line_number":1033,"context_line":"    def test_validate_none(self):"},{"line_number":1034,"context_line":"        self.assertIsNone(validators.validate_ip_or_subnet_or_none(None))"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_0069ab8b","line":1031,"in_reply_to":"1a6eadb0_ad1b0372","updated":"2016-12-19 14:12:05.000000000","message":"I won\u0027t loose sleep either way.\nMy preference would be to reduce these tests and leverage the fact that most of this is already tested, but I don\u0027t belabor.","commit_id":"a7cc0cae30d554a458ec3bb72c95e172dce33850"}],"releasenotes/notes/validator_ip_or_subnet_or_none-0175f906a9113954.yaml":[{"author":{"_account_id":5367,"name":"boden","email":"bodenvmw@gmail.com","username":"boden"},"change_message_id":"4f702d8bc0fb22975cd89112a0a3aefb3fe4797e","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Added validator validate_ip_or_subnet_or_none"}],"source_content_type":"text/x-yaml","patch_set":7,"id":"1a6eadb0_8212bf07","line":3,"range":{"start_line":3,"start_character":20,"end_line":3,"end_character":49},"updated":"2016-12-14 23:06:26.000000000","message":"Nit: code references seems to format better if enclosed in dbl ticks::\n\n   ``validate_ip_or_subnet_or_none``","commit_id":"ba31c21fe0b79a95491fef848d25023998d95050"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"69f8ebe1d3b28fbc58b7857a0f82ad83f7619303","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Added validator validate_ip_or_subnet_or_none"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"1a6eadb0_ba85e5cf","line":3,"updated":"2016-12-16 01:17:31.000000000","message":"missing trailing period, maybe.","commit_id":"bddc699eef0257e0ce61bf22a85594169b893ed5"},{"author":{"_account_id":748,"name":"Armando Migliaccio","email":"armamig@gmail.com","username":"armando-migliaccio"},"change_message_id":"09eb58f659b10534bd731a3226f06c004fc05133","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - Added validator validate_ip_or_subnet_or_none"}],"source_content_type":"text/x-yaml","patch_set":10,"id":"1a6eadb0_5a63f141","line":3,"in_reply_to":"1a6eadb0_ba85e5cf","updated":"2016-12-16 01:19:14.000000000","message":"my suggestion is to check how these render in the build run, to make sure you\u0027re happy with the outcome. Perhaps this function name can be wrapped, but if you don\u0027t this will give someone an opportunity to collect trivialfix points. Up to you if you want to respin.\n\nhttp://docs-draft.openstack.org/12/407812/10/check/gate-neutron-lib-releasenotes/e9df4a3//releasenotes/build/html/unreleased.html","commit_id":"bddc699eef0257e0ce61bf22a85594169b893ed5"}]}
