From b21c274dd4dc117d0bb52a94a51ea61d4f9e3b02 Mon Sep 17 00:00:00 2001 From: PApostol Date: Wed, 1 Dec 2021 21:12:50 +0000 Subject: [PATCH 1/2] Remove unreachable return statements --- superset/utils/network.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/superset/utils/network.py b/superset/utils/network.py index 4a49c9a9ffc4a..f1739423f3ca2 100644 --- a/superset/utils/network.py +++ b/superset/utils/network.py @@ -38,8 +38,6 @@ def is_port_open(host: str, port: int) -> bool: finally: s.close() - return False - def is_hostname_valid(host: str) -> bool: """ @@ -51,8 +49,6 @@ def is_hostname_valid(host: str) -> bool: except socket.gaierror: return False - return False - def is_host_up(host: str) -> bool: """ From 8a00245bb437e0f5532a872f932de56dad7b8874 Mon Sep 17 00:00:00 2001 From: PApostol Date: Thu, 2 Dec 2021 20:38:08 +0000 Subject: [PATCH 2/2] Remove unnecessary int casting --- superset/utils/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/superset/utils/network.py b/superset/utils/network.py index f1739423f3ca2..8079a96e203b1 100644 --- a/superset/utils/network.py +++ b/superset/utils/network.py @@ -30,7 +30,7 @@ def is_port_open(host: str, port: int) -> bool: s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(PORT_TIMEOUT) try: - s.connect((host, int(port))) + s.connect((host, port)) s.shutdown(socket.SHUT_RDWR) return True except socket.error: