diff --git a/superset/utils/network.py b/superset/utils/network.py index 4a49c9a9ffc4a..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: @@ -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: """