)]}'
{"oslo_utils/netutils.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"3ee741e187271a68d069c1d1ad19c054fd2d08b1","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    isIPv4 \u003d netaddr.valid_ipv4(prefix)"},{"line_number":123,"context_line":"    if isIPv4:"},{"line_number":124,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":125,"context_line":"        raise TypeError(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_71754397","line":122,"updated":"2015-01-22 17:23:20.000000000","message":"Nit: Putting this in a variable doesn\u0027t seem necessary.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"31c098f156943822393aef70c26bd8c874b86600","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    isIPv4 \u003d netaddr.valid_ipv4(prefix)"},{"line_number":123,"context_line":"    if isIPv4:"},{"line_number":124,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":125,"context_line":"        raise TypeError(msg)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_3c10b7a7","line":122,"in_reply_to":"1a930d6b_71754397","updated":"2015-02-04 12:30:05.000000000","message":"Done","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"3ee741e187271a68d069c1d1ad19c054fd2d08b1","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_91a54fb7","line":131,"updated":"2015-01-22 17:23:20.000000000","message":"This seems like it should be raising a ValueError instead.\n\nThat said, given that this is existing code which is being used in other places it might be worth living with that to avoid having to make changes in all of the consumers of the function. Would it be a problem to start raising ValueErrors out of this function?","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"39a911ca249e81230d3848a5b9b89dd048d0f9f0","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_58c91277","line":131,"in_reply_to":"1a930d6b_36847a0b","updated":"2015-02-03 19:37:00.000000000","message":"If we expect a migration period as applications adopt the library version of the function anyway, let\u0027s go ahead and fix the API here in Oslo so the correct exception type is raised.\n\nIt\u0027s not clear to me whether we want to raise both TypeError and ValueError, or always raise a ValueError. Passing an IPv4 address or a bad prefix both seem like ValueErrors to me, but maybe some people look at an IPv4 address as a different type than an IPv6 address?\n\nIf we get an error from the netaddr library, should we include that message in the error we\u0027re returning?","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"4f591acfa9fc5ef6bec241e1921de7aeda2bcd23","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a930d6b_36847a0b","line":131,"in_reply_to":"1a930d6b_91a54fb7","updated":"2015-01-23 07:37:04.000000000","message":"Thanks Ben for reviewing the patch. \n\nYes, you are right, the api along with the associated test cases are carried over from Neutron. I had a quick look at Neutron and Tempest code. Tempest seems ok, but some changes would be required in Neutron if we change it to ValueError. Please let me know if you want me to change this to ValueError.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"f9b7c4227b7481d6efd1e87b66d2a5791a2ec9de","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f0777f9d","line":131,"in_reply_to":"da86d52c_0ce58adb","updated":"2015-02-16 06:42:28.000000000","message":"On a close look, I saw that TypeError as also raised by netaddr apis when an invalid prefix type (i.e., instead of prefix a dict) is passed. So catching both ValueError and TypeError in this api would be the right way to go.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"a10ccc3aa6a0c7f315f7812a9f8f848f56495b58","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_0ce58adb","line":131,"in_reply_to":"da86d52c_1dceac83","updated":"2015-02-11 04:46:30.000000000","message":"Yes Sean, I agree. I\u0027ll give it few more days to see if there are further comments from other reviewers before spinning up another patch. Thanks.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"f00fc02068f27f37ccea78a3dc2785841fd99267","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_1dceac83","line":131,"in_reply_to":"da86d52c_47c5b33b","updated":"2015-02-10 18:18:38.000000000","message":"Since we seem to be doing essentially the same thing (pretty printing a log message) in both cases, I think you have the right idea. It cuts down the size of the patch at least.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"31c098f156943822393aef70c26bd8c874b86600","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_5cdd6bdf","line":131,"in_reply_to":"da86d52c_58c91277","updated":"2015-02-04 12:30:05.000000000","message":"Personally, I feel we can change it to ValueError, but it would be good to know the views of other Neutron team members. \n\nI\u0027ll bring it up in IPv6 subteam meeting to know their views on it.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":4656,"name":"Sean M. Collins","email":"sean@coreitpro.com","username":"scollins"},"change_message_id":"e42db0f7ad5bf4b840f425edfdc0849e00e4098d","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_af4acb80","line":131,"in_reply_to":"da86d52c_5cdd6bdf","updated":"2015-02-10 16:07:51.000000000","message":"Yes, changing to ValueError seems correct to me, since we already are catching TypeError when the wrong type is being passed into the call to netaddr.IPNetwork\u0027s constructor, like if a list or dict is passed instead of a string. The AddrFormatError appears to be raised when the contents of the string are junk.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"32132a26849d5508ccad33cc1f27a0a441ca4819","unresolved":false,"context_lines":[{"line_number":128,"context_line":"        prefix \u003d netaddr.IPNetwork(prefix)"},{"line_number":129,"context_line":"        return netaddr.IPAddress(prefix.first + eui64 ^ (1 \u003c\u003c 57))"},{"line_number":130,"context_line":"    except (ValueError, netaddr.AddrFormatError):"},{"line_number":131,"context_line":"        raise TypeError(_(\u0027Bad prefix or mac format for generating IPv6 \u0027"},{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_47c5b33b","line":131,"in_reply_to":"da86d52c_af4acb80","updated":"2015-02-10 17:35:40.000000000","message":"Thanks Sean. What is your opinion on simply raising a ValueError instead of TypeError (i.e., have a single error code raised instead of raising both in this api).","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"39a911ca249e81230d3848a5b9b89dd048d0f9f0","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"},{"line_number":135,"context_line":"        raise TypeError(_(\u0027Bad prefix type for generate IPv6 address by \u0027"},{"line_number":136,"context_line":"                          \u0027EUI-64: %s\u0027) % prefix)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_187dda1c","line":135,"updated":"2015-02-03 19:37:00.000000000","message":"\"for generate\" -\u003e \"for generating\"","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"31c098f156943822393aef70c26bd8c874b86600","unresolved":false,"context_lines":[{"line_number":132,"context_line":"                          \u0027address by EUI-64: %(prefix)s, %(mac)s:\u0027)"},{"line_number":133,"context_line":"                        % {\u0027prefix\u0027: prefix, \u0027mac\u0027: mac})"},{"line_number":134,"context_line":"    except TypeError:"},{"line_number":135,"context_line":"        raise TypeError(_(\u0027Bad prefix type for generate IPv6 address by \u0027"},{"line_number":136,"context_line":"                          \u0027EUI-64: %s\u0027) % prefix)"},{"line_number":137,"context_line":""},{"line_number":138,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_fcc37fea","line":135,"in_reply_to":"da86d52c_187dda1c","updated":"2015-02-04 12:30:05.000000000","message":"Done","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"39a911ca249e81230d3848a5b9b89dd048d0f9f0","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    if _IS_IPV6_ENABLED is None:"},{"line_number":152,"context_line":"        disabled_ipv6_path \u003d \"/proc/sys/net/ipv6/conf/default/disable_ipv6\""},{"line_number":153,"context_line":"        if os.path.exists(disabled_ipv6_path):"},{"line_number":154,"context_line":"            with open(disabled_ipv6_path, \u0027r\u0027) as f:"},{"line_number":155,"context_line":"                disabled \u003d f.read().strip()"},{"line_number":156,"context_line":"            _IS_IPV6_ENABLED \u003d disabled \u003d\u003d \"0\""},{"line_number":157,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_38f45e86","line":154,"updated":"2015-02-03 19:37:00.000000000","message":"This will raise an unhandled IOError if the calling process doesn\u0027t have read access to the path. Is that likely, or is it always world readable?","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"31c098f156943822393aef70c26bd8c874b86600","unresolved":false,"context_lines":[{"line_number":151,"context_line":"    if _IS_IPV6_ENABLED is None:"},{"line_number":152,"context_line":"        disabled_ipv6_path \u003d \"/proc/sys/net/ipv6/conf/default/disable_ipv6\""},{"line_number":153,"context_line":"        if os.path.exists(disabled_ipv6_path):"},{"line_number":154,"context_line":"            with open(disabled_ipv6_path, \u0027r\u0027) as f:"},{"line_number":155,"context_line":"                disabled \u003d f.read().strip()"},{"line_number":156,"context_line":"            _IS_IPV6_ENABLED \u003d disabled \u003d\u003d \"0\""},{"line_number":157,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_1cb5b37d","line":154,"in_reply_to":"da86d52c_38f45e86","updated":"2015-02-04 12:30:05.000000000","message":"It is world readable - http://lxr.free-electrons.com/source/net/ipv6/af_inet6.c?v\u003d3.12#L87","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"39a911ca249e81230d3848a5b9b89dd048d0f9f0","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        else:"},{"line_number":158,"context_line":"            _IS_IPV6_ENABLED \u003d False"},{"line_number":159,"context_line":"        if not _IS_IPV6_ENABLED:"},{"line_number":160,"context_line":"            LOG.info(_LI(\"IPv6 is not enabled on this system.\"))"},{"line_number":161,"context_line":"    return _IS_IPV6_ENABLED"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_f81006aa","line":160,"updated":"2015-02-03 19:37:00.000000000","message":"The calling application can log if it wants to, but the library shouldn\u0027t.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"31c098f156943822393aef70c26bd8c874b86600","unresolved":false,"context_lines":[{"line_number":157,"context_line":"        else:"},{"line_number":158,"context_line":"            _IS_IPV6_ENABLED \u003d False"},{"line_number":159,"context_line":"        if not _IS_IPV6_ENABLED:"},{"line_number":160,"context_line":"            LOG.info(_LI(\"IPv6 is not enabled on this system.\"))"},{"line_number":161,"context_line":"    return _IS_IPV6_ENABLED"},{"line_number":162,"context_line":""},{"line_number":163,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da86d52c_5cb2cb94","line":160,"in_reply_to":"da86d52c_f81006aa","updated":"2015-02-04 12:30:05.000000000","message":"Sure Doug, will update it in the next patch.","commit_id":"0cf6b83d52616fa1c2c94c53b6a3f3af6ac9e8fe"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"d5ff9b42ee14d76d39051ed84c209225575defc8","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises ValueError, TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    if netaddr.valid_ipv4(prefix):"},{"line_number":123,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":124,"context_line":"        raise TypeError(msg)"},{"line_number":125,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_360b8125","line":122,"updated":"2015-02-17 23:27:31.000000000","message":"It looks like prefix would still be a string here, so I\u0027m inclined to agree with Doug that this one should also be changed to a ValueError.","commit_id":"7a2b4cfb4f0b871c8d23868a135e7e2d871529e3"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"d097641e49d6eac8d34702875eca09dad03ae812","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises ValueError, TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    if netaddr.valid_ipv4(prefix):"},{"line_number":123,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":124,"context_line":"        raise TypeError(msg)"},{"line_number":125,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_707ed36b","line":122,"in_reply_to":"da86d52c_360b8125","updated":"2015-02-18 08:11:50.000000000","message":"@Ben, I thought about this but noticed that valid_ipv4 is not generating a  ValueError when we pass any string/number/ipv6 address etc. \nOTOH when we pass an invalid type, it generates a TypeError, hence I retained the TypeError. \n\nIf you think ValueError would be generated for some particular input, please let me know and I will have a look at it. Thanks.","commit_id":"7a2b4cfb4f0b871c8d23868a135e7e2d871529e3"},{"author":{"_account_id":10257,"name":"Sridhar Gaddam","email":"sgaddam@redhat.com","username":"sridhargaddam"},"change_message_id":"ea0902fc0b80b427a48e941f095466f4b45c0d5c","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises ValueError, TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    if netaddr.valid_ipv4(prefix):"},{"line_number":123,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":124,"context_line":"        raise TypeError(msg)"},{"line_number":125,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_fdd0bdf8","line":122,"in_reply_to":"da86d52c_374fdf93","updated":"2015-02-18 19:50:26.000000000","message":"I see your point @Ben. I\u0027ll update the patch accordingly. Thanks.","commit_id":"7a2b4cfb4f0b871c8d23868a135e7e2d871529e3"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"d4188eefd7b551a33a9b25fd1d8b271c0cf763d0","unresolved":false,"context_lines":[{"line_number":119,"context_line":"    :raises ValueError, TypeError: For any invalid input."},{"line_number":120,"context_line":"    \"\"\""},{"line_number":121,"context_line":"    # Check if the prefix is an IPv4 address"},{"line_number":122,"context_line":"    if netaddr.valid_ipv4(prefix):"},{"line_number":123,"context_line":"        msg \u003d _(\"Unable to generate IP address by EUI64 for IPv4 prefix\")"},{"line_number":124,"context_line":"        raise TypeError(msg)"},{"line_number":125,"context_line":"    try:"}],"source_content_type":"text/x-python","patch_set":11,"id":"da86d52c_374fdf93","line":122,"in_reply_to":"da86d52c_707ed36b","updated":"2015-02-18 16:11:25.000000000","message":"I wouldn\u0027t expect valid_ipv4 to ever raise a ValueError.  There are only three possible classes of object you can pass to it: a string representing a valid ipv4 address, a string not representing a valid ipv4 address, or not a string.  Only the last would raise an exception, and it would correctly be a TypeError.\n\nIn our case, however, we\u0027re also raising an exception for the first case because this code isn\u0027t for use with ipv4 addresses.  In that case prefix is a valid type (string), but has an invalid value which tells me we should raise a ValueError.  Does that make sense?","commit_id":"7a2b4cfb4f0b871c8d23868a135e7e2d871529e3"}]}
