)]}'
{"ironic_python_agent/netutils.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"34eac0c6bf13501caea5f8fbde70cafbd9cd15d4","unresolved":true,"context_lines":[{"line_number":212,"context_line":"    return lldp_info"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"def _extract_address(lines):"},{"line_number":216,"context_line":"    \"\"\"Extract an usable IP address from the supplied lines."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    :param lines: The split lines of an \"ip addr show $interface\" command."}],"source_content_type":"text/x-python","patch_set":4,"id":"8d8fbb18_e3c90fb0","line":215,"updated":"2023-04-17 15:00:57.000000000","message":"As discussed on IRC, the list of interfaces and their addresses can be obtained from psutil which we already use for other purposes: https://paste.opendev.org/show/b2ocscuZRaG99nymD9PB/","commit_id":"30b360d5438b85d43356ede831284b33b9dd172b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f791d4dee43a7d8c965262c9e4f22f503ec214a2","unresolved":true,"context_lines":[{"line_number":212,"context_line":"    return lldp_info"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"def _extract_address(lines):"},{"line_number":216,"context_line":"    \"\"\"Extract an usable IP address from the supplied lines."},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"    :param lines: The split lines of an \"ip addr show $interface\" command."}],"source_content_type":"text/x-python","patch_set":4,"id":"f1489748_46464fdc","line":215,"in_reply_to":"8d8fbb18_e3c90fb0","updated":"2023-04-17 16:56:36.000000000","message":"Interesting! Gerrit didn\u0027t show me this comment a half hour ago! Anyhow, I\u0027ve replied a little further below as to a conundrum which likely needs to be evaluated, although it was a conundrum with netifaces anyway, we should be defensive with the data we get and return.","commit_id":"30b360d5438b85d43356ede831284b33b9dd172b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f2a8776df49efd3377cf8f4ef4a297220c7e1b21","unresolved":true,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"def get_ipv6_addr(interface_id):"},{"line_number":241,"context_line":"    try:"},{"line_number":242,"context_line":"        out, _ \u003d utils.execute(\u0027ip\u0027, \u0027-6\u0027, \u0027addr\u0027, \u0027show\u0027, interface_id)"},{"line_number":243,"context_line":"    except OSError:"},{"line_number":244,"context_line":"        LOG.error(\u0027The IP command is required. Could not get IPv4 address.\u0027)"},{"line_number":245,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":4,"id":"9813cbfe_85853a2d","line":242,"updated":"2023-04-17 16:30:58.000000000","message":"So a possible discussion exists here with v6 addresses. \n\nDmitry has suggested that we use psutil instead.\n\nExcept, there is no way to strip out privacy (temporary)/link level addresses without evaluating the address ranging which seems fragile. The point, afaik, is to extract a reachable address.\n\nGranted, psutil would kind of just follow the prior pattern and still have the same prior risk of not giving us a global valid address potentially. I guess to make matters worse, some of my \n\nSo, there is a positive to each, I guess.\n\nExample, Both are All these are privacy and link level addresses...\n\n    snicaddr(family\u003d\u003cAddressFamily.AF_INET6: 10\u003e, \n    address\u003d\u00272601:7700:4f11:18:cba3:d995:4983:4fa9\u0027, \n    netmask\u003d\u0027ffff:ffff:ffff:ffff::\u0027, \n     broadcast\u003dNone, ptp\u003dNone), snicaddr(family\u003d\u003cAddressFamily.AF_INET6: 10\u003e, \n     address\u003d\u00272601:7700:4f11:18:fad1:11ff:fead:6fcb\u0027, \n    netmask\u003d\u0027ffff:ffff:ffff:ffff::\u0027, \n     broadcast\u003dNone, ptp\u003dNone), snicaddr(family\u003d\u003cAddressFamily.AF_INET6: 10\u003e, \n     address\u003d\u0027fe80::fad1:11ff:fffd:6fcb%wlp2s0\u0027, netmask\u003d\u0027ffff:ffff:ffff:ffff::\u0027, \n     broadcast\u003dNone, ptp\u003dNone),\n\nThe downside, is my machine\u0027s actual v6 address is 7 entries down which means the existing code would snag a privacy or a link level address in the order assigned.","commit_id":"30b360d5438b85d43356ede831284b33b9dd172b"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"248479c37f8b4d750cfe8243b36d4d16c4fedc1d","unresolved":true,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"def get_ipv6_addr(interface_id):"},{"line_number":241,"context_line":"    try:"},{"line_number":242,"context_line":"        out, _ \u003d utils.execute(\u0027ip\u0027, \u0027-6\u0027, \u0027addr\u0027, \u0027show\u0027, interface_id)"},{"line_number":243,"context_line":"    except OSError:"},{"line_number":244,"context_line":"        LOG.error(\u0027The IP command is required. Could not get IPv4 address.\u0027)"},{"line_number":245,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":4,"id":"f190fe03_a35f2439","line":242,"in_reply_to":"9813cbfe_85853a2d","updated":"2023-04-20 12:05:59.000000000","message":"Maybe this will help? https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_private https://docs.python.org/3/library/ipaddress.html#ipaddress.IPv4Address.is_link_local etc","commit_id":"30b360d5438b85d43356ede831284b33b9dd172b"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"556ef38864140ee695eb774288f74bcd9e4a99a6","unresolved":true,"context_lines":[{"line_number":239,"context_line":""},{"line_number":240,"context_line":"def get_ipv6_addr(interface_id):"},{"line_number":241,"context_line":"    try:"},{"line_number":242,"context_line":"        out, _ \u003d utils.execute(\u0027ip\u0027, \u0027-6\u0027, \u0027addr\u0027, \u0027show\u0027, interface_id)"},{"line_number":243,"context_line":"    except OSError:"},{"line_number":244,"context_line":"        LOG.error(\u0027The IP command is required. Could not get IPv4 address.\u0027)"},{"line_number":245,"context_line":"        return None"}],"source_content_type":"text/x-python","patch_set":4,"id":"5795eea4_58ae04a7","line":242,"in_reply_to":"f190fe03_a35f2439","updated":"2023-04-24 23:58:17.000000000","message":"Partially, but it doesn\u0027t solve for https://datatracker.ietf.org/doc/html/rfc4941\n\nThe kernel knows they are temporary privacy addresses, but they can change.","commit_id":"30b360d5438b85d43356ede831284b33b9dd172b"}],"ironic_python_agent/tests/unit/test_hardware.py":[{"author":{"_account_id":4571,"name":"Steve Baker","email":"sbaker@redhat.com","username":"steve-stevebaker"},"change_message_id":"8f11e0fa9ae249a4a4e2d9a359ed090bc63d868d","unresolved":true,"context_lines":[{"line_number":699,"context_line":"            (IPV4_ADDRESS, \u0027\u0027),"},{"line_number":700,"context_line":"            (IPV6_ADDRESS, \u0027\u0027),"},{"line_number":701,"context_line":"            (\u0027em0\\n\u0027, \u0027\u0027)"},{"line_number":702,"context_line":"        ]"},{"line_number":703,"context_line":"        mock_get_mac.mock_has_carrier \u003d True"},{"line_number":704,"context_line":"        mock_get_mac.return_value \u003d \u002700:0c:29:8c:11:b1\u0027"},{"line_number":705,"context_line":"        interfaces \u003d self.hardware.list_network_interfaces()"}],"source_content_type":"text/x-python","patch_set":3,"id":"0eed819b_5738e469","line":702,"updated":"2023-04-10 21:36:42.000000000","message":"I think these are missing the 2 ip link calls in netutils._add_vlan_interface, the StopIteration is not being logged as expected.","commit_id":"d767d0be8400d21dc2480c5b8d922e2a3a7c5eca"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"f2a8776df49efd3377cf8f4ef4a297220c7e1b21","unresolved":false,"context_lines":[{"line_number":699,"context_line":"            (IPV4_ADDRESS, \u0027\u0027),"},{"line_number":700,"context_line":"            (IPV6_ADDRESS, \u0027\u0027),"},{"line_number":701,"context_line":"            (\u0027em0\\n\u0027, \u0027\u0027)"},{"line_number":702,"context_line":"        ]"},{"line_number":703,"context_line":"        mock_get_mac.mock_has_carrier \u003d True"},{"line_number":704,"context_line":"        mock_get_mac.return_value \u003d \u002700:0c:29:8c:11:b1\u0027"},{"line_number":705,"context_line":"        interfaces \u003d self.hardware.list_network_interfaces()"}],"source_content_type":"text/x-python","patch_set":3,"id":"35d0a0b4_839d0d1c","line":702,"in_reply_to":"0eed819b_5738e469","updated":"2023-04-17 16:30:58.000000000","message":"Done","commit_id":"d767d0be8400d21dc2480c5b8d922e2a3a7c5eca"}]}
