)]}'
{"oslo_utils/netutils.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a8307b18ebfb51f7a341bcd95c4fc1b9786e0b52","unresolved":true,"context_lines":[{"line_number":85,"context_line":"    return (host, None if port is None else int(port))"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def is_valid_ipv4(address, flags\u003d0):"},{"line_number":89,"context_line":"    \"\"\"Verify that address represents a valid IPv4 address."},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"    :param address: Value to verify"}],"source_content_type":"text/x-python","patch_set":1,"id":"c667a40f_48badc63","line":88,"updated":"2021-02-03 10:58:10.000000000","message":"We\u0027re supposed to be an abstraction layer over the underlying library so I don\u0027t think we need to expose the exact same semantics. As this stands, someone would need to read the netaddr docs, at which point they\u0027d surely be better off just using netutil? As far as I can tell from reading, the old \u0027inet_aton\u0027 behavior is deprecated and \u0027inet_pton\u0027 should be preferred [1] since it supports IPv6 [2]. That\u0027s irrelevant though and what we actually care about here is that \u0027inet_pton\u0027 only accepts the \"presentation format\", which is much stricter (only \u0027a.b.c.d\u0027, and nothing else) rather than the address format (\u0027a.b.c.d\u0027, \u0027a.b.c\u0027, \u0027a.b\u0027 or \u0027a\u0027) supported by \u0027inet_pton\u0027. Given we only care about the \u0027INET_PTON\u0027 flag (since it get us this \"strict\" behavior) and not the other \u0027ZEROFILL\u0027 flag, could we add a ternary \u0027strict\u0027 flag? We might want to look at enabling that by default, with something like this:\n\n  if strict is None,\n    try to convert in strict mode\n    if conversion passes\n      return True\n    else\n      try to convert in non-strict mode\n      if conversion passes\n        log a warning stating that this behavior is deprecated and you should pass strict\u003dFalse if\n        you want to preserve legacy behavior,\n        return True\n      else\n        return False\n  else\n    if strict is True:\n      try to convert in strict mode,\n      return result\n    else\n      try to convert in non-strict mode,\n      return result\n\n[1] https://stackoverflow.com/a/5328184/613428\n[2] https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.3.0/com.ibm.zos.v2r3.bpxbd00/ipton.htm","commit_id":"6fabbc69e50079b604e1417725959a5e6a5e1c7c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a8307b18ebfb51f7a341bcd95c4fc1b9786e0b52","unresolved":true,"context_lines":[{"line_number":91,"context_line":"    :param address: Value to verify"},{"line_number":92,"context_line":"    :type address: string"},{"line_number":93,"context_line":"    :param flags: Convert IPv4 addresses from text to binary form. If"},{"line_number":94,"context_line":"    netutils.INET_PTON is passed addressed will be converted."},{"line_number":95,"context_line":"    :type flags: integer"},{"line_number":96,"context_line":"    :returns: bool"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"823de869_c0782bdd","line":94,"range":{"start_line":94,"start_character":33,"end_line":94,"end_character":42},"updated":"2021-02-03 10:58:10.000000000","message":"addresses","commit_id":"6fabbc69e50079b604e1417725959a5e6a5e1c7c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a8307b18ebfb51f7a341bcd95c4fc1b9786e0b52","unresolved":true,"context_lines":[{"line_number":91,"context_line":"    :param address: Value to verify"},{"line_number":92,"context_line":"    :type address: string"},{"line_number":93,"context_line":"    :param flags: Convert IPv4 addresses from text to binary form. If"},{"line_number":94,"context_line":"    netutils.INET_PTON is passed addressed will be converted."},{"line_number":95,"context_line":"    :type flags: integer"},{"line_number":96,"context_line":"    :returns: bool"},{"line_number":97,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7f619927_52520fc5","line":94,"range":{"start_line":94,"start_character":3,"end_line":94,"end_character":4},"updated":"2021-02-03 10:58:10.000000000","message":"nit: indentation","commit_id":"6fabbc69e50079b604e1417725959a5e6a5e1c7c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a8307b18ebfb51f7a341bcd95c4fc1b9786e0b52","unresolved":true,"context_lines":[{"line_number":95,"context_line":"    :type flags: integer"},{"line_number":96,"context_line":"    :returns: bool"},{"line_number":97,"context_line":""},{"line_number":98,"context_line":"    .. versionadded:: 1.1"},{"line_number":99,"context_line":"    \"\"\""},{"line_number":100,"context_line":"    try:"},{"line_number":101,"context_line":"        return netaddr.valid_ipv4(address, flags\u003dflags)"}],"source_content_type":"text/x-python","patch_set":1,"id":"f85427cb_e2900c9e","line":98,"updated":"2021-02-03 10:58:10.000000000","message":"Can you add a versionchanged directive?","commit_id":"6fabbc69e50079b604e1417725959a5e6a5e1c7c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":93,"context_line":"    :type flags: bool"},{"line_number":94,"context_line":"    :returns: bool"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    .. versionadded:: 1.1"},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    if strict is not None:"},{"line_number":99,"context_line":"        flag \u003d INET_PTON if strict is True else 0"}],"source_content_type":"text/x-python","patch_set":3,"id":"171f0d10_bccb74ad","line":96,"updated":"2021-02-05 12:49:00.000000000","message":"versionchanged","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":96,"context_line":"    .. versionadded:: 1.1"},{"line_number":97,"context_line":"    \"\"\""},{"line_number":98,"context_line":"    if strict is not None:"},{"line_number":99,"context_line":"        flag \u003d INET_PTON if strict is True else 0"},{"line_number":100,"context_line":"        try:"},{"line_number":101,"context_line":"            return netaddr.valid_ipv4(address, flags\u003dflag)"},{"line_number":102,"context_line":"        except netaddr.AddrFormatError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"670e5d35_7a6f5978","line":99,"range":{"start_line":99,"start_character":35,"end_line":99,"end_character":43},"updated":"2021-02-05 12:49:00.000000000","message":"this isn\u0027t necessary - you can rely on the truthy check. You could also do\n\n  strict and INEP_PTON or 0","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":101,"context_line":"            return netaddr.valid_ipv4(address, flags\u003dflag)"},{"line_number":102,"context_line":"        except netaddr.AddrFormatError:"},{"line_number":103,"context_line":"            return False"},{"line_number":104,"context_line":"    else:"},{"line_number":105,"context_line":"        try:"},{"line_number":106,"context_line":"            if netaddr.valid_ipv4(address, flags\u003dINET_PTON):"},{"line_number":107,"context_line":"                return True"}],"source_content_type":"text/x-python","patch_set":3,"id":"e7332973_3f964cf8","line":104,"range":{"start_line":104,"start_character":4,"end_line":104,"end_character":9},"updated":"2021-02-05 12:49:00.000000000","message":"nit: you can drop this and dent the entire block. The above block will always return if we enter it","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"},{"author":{"_account_id":27954,"name":"Moisés Guimarães de Medeiros","email":"guimaraes@pm.me","username":"moguimar"},"change_message_id":"aed5cdb0486be42f67111beecf982944ee610816","unresolved":true,"context_lines":[{"line_number":82,"context_line":"    return (host, None if port is None else int(port))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"def is_valid_ipv4(address, strict\u003dNone):"},{"line_number":86,"context_line":"    \"\"\"Verify that address represents a valid IPv4 address."},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    :param address: Value to verify"}],"source_content_type":"text/x-python","patch_set":4,"id":"04a00ab5_1b386cd9","line":85,"range":{"start_line":85,"start_character":27,"end_line":85,"end_character":38},"updated":"2021-02-05 15:49:05.000000000","message":"why isn\u0027t this a boolean default to False instead? I guess the code would get way less complex.","commit_id":"3288539a0b3be6b69efd2630b79133b918bb079b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"e80c1db270978f46551d9d265783eb1fe123859b","unresolved":true,"context_lines":[{"line_number":82,"context_line":"    return (host, None if port is None else int(port))"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"def is_valid_ipv4(address, strict\u003dNone):"},{"line_number":86,"context_line":"    \"\"\"Verify that address represents a valid IPv4 address."},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"    :param address: Value to verify"}],"source_content_type":"text/x-python","patch_set":4,"id":"521002b1_10625b6d","line":85,"range":{"start_line":85,"start_character":27,"end_line":85,"end_character":38},"in_reply_to":"04a00ab5_1b386cd9","updated":"2021-02-05 18:10:12.000000000","message":"Because we want to move to setting it to True in the future. If we set it to False, we have no way to warn users that are relying on the current value (False) that it will be changing soon","commit_id":"3288539a0b3be6b69efd2630b79133b918bb079b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"d6e4c686b959dcee98f045cee31bf13106826292","unresolved":true,"context_lines":[{"line_number":115,"context_line":"                LOG.warn("},{"line_number":116,"context_line":"                    \u0027Converting in non strict mode is deprecated. \u0027"},{"line_number":117,"context_line":"                    \u0027You should pass strict\u003dFalse if you want to \u0027"},{"line_number":118,"context_line":"                    \u0027preserve legacy behavior\u0027)"},{"line_number":119,"context_line":"                return True"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":4,"id":"29908f12_0a26527e","line":118,"updated":"2021-02-05 14:14:24.000000000","message":"Do we want this to be a log, or should we use \u0027warnings\u0027 and emit a DeprecationWarning?","commit_id":"3288539a0b3be6b69efd2630b79133b918bb079b"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"35da8fe548db0373a72a0db7698adb0559dd4a35","unresolved":true,"context_lines":[{"line_number":115,"context_line":"                LOG.warn("},{"line_number":116,"context_line":"                    \u0027Converting in non strict mode is deprecated. \u0027"},{"line_number":117,"context_line":"                    \u0027You should pass strict\u003dFalse if you want to \u0027"},{"line_number":118,"context_line":"                    \u0027preserve legacy behavior\u0027)"},{"line_number":119,"context_line":"                return True"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                return False"}],"source_content_type":"text/x-python","patch_set":4,"id":"839226d0_227a999b","line":118,"in_reply_to":"29908f12_0a26527e","updated":"2021-02-05 14:15:55.000000000","message":"For what it\u0027s worth, I see examples of both here. warnings might be better since that\u0027s explicitly what it\u0027s designed for, but I\u0027m okay with this approach also","commit_id":"3288539a0b3be6b69efd2630b79133b918bb079b"}],"oslo_utils/tests/test_netutils.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":166,"context_line":"        self.assertFalse(netutils.is_valid_ipv4(\u0027\u0027))"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        self.assertTrue(netutils.is_valid_ipv4(\u002710\u0027))"},{"line_number":169,"context_line":"        mock_log.warn.assert_called_with(expected_log)"},{"line_number":170,"context_line":"        self.assertTrue(netutils.is_valid_ipv4(\u002710.10\u0027))"},{"line_number":171,"context_line":"        mock_log.warn.assert_called_with(expected_log)"},{"line_number":172,"context_line":"        self.assertTrue(netutils.is_valid_ipv4(\u002710.10.10\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"e073f796_905aac3a","line":169,"updated":"2021-02-05 12:49:00.000000000","message":"you need to reset the mock_log before the next call. It still has the result of the last call stored so this will always be true now","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":180,"context_line":"        )"},{"line_number":181,"context_line":"        self.assertFalse("},{"line_number":182,"context_line":"            netutils.is_valid_ipv4(\u002710.10.10\u0027, strict\u003dTrue)"},{"line_number":183,"context_line":"        )"},{"line_number":184,"context_line":"        self.assertTrue("},{"line_number":185,"context_line":"            netutils.is_valid_ipv4(\u002710\u0027, strict\u003dFalse)"},{"line_number":186,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":3,"id":"43208200_5dfa59a9","line":183,"updated":"2021-02-05 12:49:00.000000000","message":"Can you check a valid one too?","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":189,"context_line":"        )"},{"line_number":190,"context_line":"        self.assertTrue("},{"line_number":191,"context_line":"            netutils.is_valid_ipv4(\u002710.10.10\u0027, strict\u003dFalse)"},{"line_number":192,"context_line":"        )"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def test_is_valid_ipv6(self):"},{"line_number":195,"context_line":"        self.assertTrue(netutils.is_valid_ipv6(\u0027::1\u0027))"}],"source_content_type":"text/x-python","patch_set":3,"id":"e4070ece_d3e7d9d1","line":192,"updated":"2021-02-05 12:49:00.000000000","message":"Can you check with a valid one too?","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"}],"releasenotes/notes/allow-to-convert-ipv4-address-from-text-to-binary-8c46ad2d9989e8c5.yaml":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"a8307b18ebfb51f7a341bcd95c4fc1b9786e0b52","unresolved":true,"context_lines":[{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Add flags to `netutils.is_valid_ipv4` and define `INET_PTON` to"},{"line_number":5,"context_line":"    allow users to convert IPv4 addresses from text to binary form."}],"source_content_type":"text/x-yaml","patch_set":1,"id":"9d463b54_b411f484","line":5,"updated":"2021-02-03 10:58:10.000000000","message":"This isn\u0027t that helpful. The \u0027is_valid_ipv4\u0027 function doesn\u0027t convert anything, at least not that the user can see. As far as the user is concerned, it simply checks if an IP address is valid. What you\u0027re trying to do is avoid things like \u0027is_valid_ipv4(10)\u0027 being accepted. As noted previously, those are valid IP addresses if using the \u0027aton\u0027 flag but not if using the \u0027pton\u0027 flag but I suspect that most people actually expect the pton behavior. Can you reword this saying something like\n\n  Add a ``strict`` flag allowing users to restrict validation to IP addresses in\n  presentation format (``a.b.c.d``) as opposed to address format (``a.b.c.d``,\n  ``a.b.c``, ``a.b``, ``a``).","commit_id":"6fabbc69e50079b604e1417725959a5e6a5e1c7c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"42b774a6d8928bc2278cc40684d677461c043dba","unresolved":true,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"features:"},{"line_number":3,"context_line":"  - |"},{"line_number":4,"context_line":"    Add a ``strict`` flag allowing users to restrict validation to IP"},{"line_number":5,"context_line":"    addresses in presentation format (``a.b.c.d``) as opposed to address"},{"line_number":6,"context_line":"    format (``a.b.c.d``, ``a.b.c``, ``a.b``, ``a``)."}],"source_content_type":"text/x-yaml","patch_set":3,"id":"fbfba74b_94ba5ade","line":4,"range":{"start_line":4,"start_character":25,"end_line":4,"end_character":26},"updated":"2021-02-05 12:49:00.000000000","message":"to what?","commit_id":"b2ea807c6de231ae3baf8299d5a5b3a119aea1f5"}]}
