Skip to content
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bastion/azext_bastion/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ def __init__(self, cli_ctx, local_addr, local_port, bastion, bastion_endpoint, r
def is_port_open(self):
is_port_open = False
with closing(socket.socket(socket.AF_INET, socket.SOCK_STREAM)) as sock:
if sock.connect_ex(('', self.local_port)) == 0:
logger.info('Port %s is NOT open', self.local_port)
else:
if sock.connect_ex((self.local_addr, self.local_port)) == 0:
logger.info('Port %s is open', self.local_port)
Comment thread
sabbour marked this conversation as resolved.
is_port_open = True
else:
logger.info('Port %s is NOT open', self.local_port)
Comment thread
sabbour marked this conversation as resolved.
Outdated
return is_port_open

def _get_auth_token(self):
Expand Down
Loading