You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/09/07 21:37:04 UTC

[GitHub] [airflow] uranusjr commented on a diff in pull request #26222: For worker log servers only bind to IPV6 when dual stack is available

uranusjr commented on code in PR #26222:
URL: https://github.com/apache/airflow/pull/26222#discussion_r965321279


##########
airflow/utils/serve_logs.py:
##########
@@ -38,6 +40,15 @@
 logger = logging.getLogger(__name__)
 
 
+def has_dualstack_ipv6():
+    """
+    Method to check if dual stack is supported was added in Python 3.8
+    """
+    if hasattr(socket, 'has_dualstack_ipv6'):
+        return socket.has_dualstack_ipv6()
+    return False

Review Comment:
   Since this function is used only once, it’s probably easier to just do
   
   ```python
   if getattr(socket, "has_dualstack_ipv6", bool)():
       ...
   ```
   
   instead.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org