Skip to content

Commit

Permalink
Fix mypy errors (#504)
Browse files Browse the repository at this point in the history
  • Loading branch information
abhinavsingh authored Feb 21, 2021
1 parent 20fb794 commit 864a0b8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions proxy/core/ssh/tunnel.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:copyright: (c) 2013-present by Abhinav Singh and contributors.
:license: BSD, see LICENSE for more details.
"""
from typing import Tuple, Callable
from typing import Optional, Tuple, Callable

import paramiko

Expand Down Expand Up @@ -44,11 +44,15 @@ def run(self) -> None:
key_filename=self.private_pem_key
)
print('SSH connection established...')
transport: paramiko.transport.Transport = ssh.get_transport()
transport: Optional[paramiko.transport.Transport] = ssh.get_transport(
)
assert transport is not None
transport.request_port_forward('', self.remote_proxy_port)
print('Tunnel port forward setup successful...')
while True:
conn: paramiko.channel.Channel = transport.accept(timeout=1)
conn: Optional[paramiko.channel.Channel] = transport.accept(
timeout=1)
assert conn is not None
e = transport.get_exception()
if e:
raise e
Expand Down

0 comments on commit 864a0b8

Please sign in to comment.