)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":33742,"name":"Jonas Schäfer","email":"jonas.schaefer@cloudandheat.com","username":"jssfr"},"change_message_id":"653753fffe461e1f6d13da3133b7017b7382aa69","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"084d2d85_ee544756","updated":"2024-07-29 11:36:08.000000000","message":"Still need to update/write tests.","commit_id":"89a136b68879022c0c5cd81f04c9ad66ba4e5e04"},{"author":{"_account_id":33742,"name":"Jonas Schäfer","email":"jonas.schaefer@cloudandheat.com","username":"jssfr"},"change_message_id":"ea2fd9407226b496d176a719c118d214ab70cab8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"01d77e87_6db204d2","in_reply_to":"084d2d85_ee544756","updated":"2024-07-29 11:39:33.000000000","message":"Done","commit_id":"89a136b68879022c0c5cd81f04c9ad66ba4e5e04"},{"author":{"_account_id":5890,"name":"Doug Goldstein","email":"cardoe@cardoe.com","username":"cardoe"},"change_message_id":"43c19a857dddaf7beefa06e0c0de4904071963cb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"bfddc2a5_82120a6c","updated":"2024-08-02 16:02:03.000000000","message":"Creative with the *_ syntax to handle AF_INET vs AF_INET6.","commit_id":"b3e398386933806d592a5db0c5749327567246e9"}],"ironic_python_agent/agent.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"fb2ed25b261f4a45df033ef0c5bb06b0b570dd7d","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                LOG.debug(\u0027Could not resolve %s, maybe no DNS\u0027, ironic_host)"},{"line_number":324,"context_line":"                ips.append(ironic_host)"},{"line_number":325,"context_line":"                continue"},{"line_number":326,"context_line":"            ips.extend(addr for _, _, _, _, (addr, *_) in addrs)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        for attempt in range(self.ip_lookup_attempts):"},{"line_number":329,"context_line":"            for ironic_host in ips:"}],"source_content_type":"text/x-python","patch_set":3,"id":"f798344b_b30aae6a","line":326,"updated":"2024-08-08 13:15:14.000000000","message":"if you want to go really fancy, use (addr for *_, (addr, *_) in addrs)\n\nalso, this can yield duplicated addresses, so maybe convert ips into a set to avoid going through the source check for the same address several times","commit_id":"b3e398386933806d592a5db0c5749327567246e9"},{"author":{"_account_id":33742,"name":"Jonas Schäfer","email":"jonas.schaefer@cloudandheat.com","username":"jssfr"},"change_message_id":"bb586b5eaa80b394d3468b5590f4ab672f4d9629","unresolved":false,"context_lines":[{"line_number":323,"context_line":"                LOG.debug(\u0027Could not resolve %s, maybe no DNS\u0027, ironic_host)"},{"line_number":324,"context_line":"                ips.append(ironic_host)"},{"line_number":325,"context_line":"                continue"},{"line_number":326,"context_line":"            ips.extend(addr for _, _, _, _, (addr, *_) in addrs)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        for attempt in range(self.ip_lookup_attempts):"},{"line_number":329,"context_line":"            for ironic_host in ips:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1be6da3c_6a68fbf8","line":326,"in_reply_to":"f798344b_b30aae6a","updated":"2024-09-09 05:27:51.000000000","message":"I applied the change to a set, however, I\u0027d like to keep the for-loop as-is. The outer tuple\u0027s number of elements is well-known, unlike the inner number of elements, which is why I chose *_ there in the first place.\n\nEDIT: I only now realized this message never went out, so this may be coming a bit late/out of context.","commit_id":"b3e398386933806d592a5db0c5749327567246e9"},{"author":{"_account_id":5890,"name":"Doug Goldstein","email":"cardoe@cardoe.com","username":"cardoe"},"change_message_id":"ff7d7d84e28e96da430d6da0c76e227b70dfb4a4","unresolved":true,"context_lines":[{"line_number":318,"context_line":"            ironic_host \u003d urlparse.urlparse(api_url).hostname"},{"line_number":319,"context_line":"            # Try resolving it in case it\u0027s not an IP address"},{"line_number":320,"context_line":"            try:"},{"line_number":321,"context_line":"                addrs \u003d socket.getaddrinfo(ironic_host, 0)"},{"line_number":322,"context_line":"            except socket.gaierror:"},{"line_number":323,"context_line":"                LOG.debug(\u0027Could not resolve %s, maybe no DNS\u0027, ironic_host)"},{"line_number":324,"context_line":"                ips.add(ironic_host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"397f682d_56066244","line":321,"updated":"2024-09-09 00:34:27.000000000","message":"so I know this is a bit of a tweak on the existing behavior but I see in case of failure you add it to the list. why don’t we first put this through the ipaddress module’s IpAddress class constructor and if it fails then attempt DNS lookup. if that fails don’t add it to the list at all and move on. that way the fast case is handled.","commit_id":"def085d2c5a4ba2b716097e9c3efd96deefad378"},{"author":{"_account_id":33742,"name":"Jonas Schäfer","email":"jonas.schaefer@cloudandheat.com","username":"jssfr"},"change_message_id":"bb586b5eaa80b394d3468b5590f4ab672f4d9629","unresolved":true,"context_lines":[{"line_number":318,"context_line":"            ironic_host \u003d urlparse.urlparse(api_url).hostname"},{"line_number":319,"context_line":"            # Try resolving it in case it\u0027s not an IP address"},{"line_number":320,"context_line":"            try:"},{"line_number":321,"context_line":"                addrs \u003d socket.getaddrinfo(ironic_host, 0)"},{"line_number":322,"context_line":"            except socket.gaierror:"},{"line_number":323,"context_line":"                LOG.debug(\u0027Could not resolve %s, maybe no DNS\u0027, ironic_host)"},{"line_number":324,"context_line":"                ips.add(ironic_host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"9923da69_5ac99148","line":321,"in_reply_to":"397f682d_56066244","updated":"2024-09-09 05:27:51.000000000","message":"@cardoe@cardoe.com I should point out that `socket.gethostbyname(\"127.0.0.1\")` already returned `127.0.0.1`, and `socket.getaddrinfo` behaves similarly. So the socket.gaierror is not raised in case an IP address is passed in, but only on genuine DNS errors.\n\nThat implies that, assuming the original author of the code had that in mind, there must be another reason for using the unresolved name in the `ips` container even if the DNS lookup failed.\n\nI can diverge from that behaviour, but because it is indeed a change I would rather have that in a separate commit so that people git blame/git logging their way to the cause have a clear idea of why this change was made.\n\n(And a good reason for why we want to make that change would be nice to have for the commit message, because admittedly I\u0027m a bit out of my depth here.)","commit_id":"def085d2c5a4ba2b716097e9c3efd96deefad378"},{"author":{"_account_id":5890,"name":"Doug Goldstein","email":"cardoe@cardoe.com","username":"cardoe"},"change_message_id":"28f568c5b8b8e4d778158251e6268dcaf50d282e","unresolved":false,"context_lines":[{"line_number":318,"context_line":"            ironic_host \u003d urlparse.urlparse(api_url).hostname"},{"line_number":319,"context_line":"            # Try resolving it in case it\u0027s not an IP address"},{"line_number":320,"context_line":"            try:"},{"line_number":321,"context_line":"                addrs \u003d socket.getaddrinfo(ironic_host, 0)"},{"line_number":322,"context_line":"            except socket.gaierror:"},{"line_number":323,"context_line":"                LOG.debug(\u0027Could not resolve %s, maybe no DNS\u0027, ironic_host)"},{"line_number":324,"context_line":"                ips.add(ironic_host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"5592fd10_bde2c86c","line":321,"in_reply_to":"9923da69_5ac99148","updated":"2024-10-02 20:21:38.000000000","message":"Acknowledged","commit_id":"def085d2c5a4ba2b716097e9c3efd96deefad378"}]}
