Prevent exception in Connection object if connection fails
This commit is contained in:
parent
011d35aa22
commit
7257ba1985
1 changed files with 1 additions and 1 deletions
|
@ -20,6 +20,7 @@ class Connection:
|
||||||
vessel (classes.vessel.Vessel): Vessel object to open connection to
|
vessel (classes.vessel.Vessel): Vessel object to open connection to
|
||||||
"""
|
"""
|
||||||
self._vessel = vessel
|
self._vessel = vessel
|
||||||
|
self._process = None
|
||||||
self._client = SSHClient()
|
self._client = SSHClient()
|
||||||
self._client.load_system_host_keys()
|
self._client.load_system_host_keys()
|
||||||
self._client.set_missing_host_key_policy(WarningPolicy)
|
self._client.set_missing_host_key_policy(WarningPolicy)
|
||||||
|
@ -29,7 +30,6 @@ class Connection:
|
||||||
self._transport = self._client.get_transport()
|
self._transport = self._client.get_transport()
|
||||||
self._transport.set_keepalive(10)
|
self._transport.set_keepalive(10)
|
||||||
self._sftp = self._client.open_sftp()
|
self._sftp = self._client.open_sftp()
|
||||||
self._process = None
|
|
||||||
|
|
||||||
def forward_tcp(self, remote=3306):
|
def forward_tcp(self, remote=3306):
|
||||||
self._process = SSHTunnelForwarder(
|
self._process = SSHTunnelForwarder(
|
||||||
|
|
Loading…
Reference in a new issue