diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-13 21:42:30 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-13 21:42:30 +0100 |
commit | 201b5d759e5a0f97d7016664e947f6ce3b632721 (patch) | |
tree | 98781fd2f93781b6b0ffb4249c5b4ae66a1741cd /bupper/_ssh_client.py | |
parent | f1ef9c053c84515761f59412a91ca3adbc8e7392 (diff) |
ssh_client/remote: add __str__ methods to ease debugging
Diffstat (limited to 'bupper/_ssh_client.py')
-rw-r--r-- | bupper/_ssh_client.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bupper/_ssh_client.py b/bupper/_ssh_client.py index f1c9e23..dec3390 100644 --- a/bupper/_ssh_client.py +++ b/bupper/_ssh_client.py @@ -13,6 +13,7 @@ class SSHConnection: """ _proxy_conn = None _client = None + _remote = None def __init__(self, remote): sock = None @@ -26,6 +27,8 @@ class SSHConnection: self._client.connect(remote.host, remote.port, remote.username, sock = sock) + self._remote = remote + def close(self): if self._client: self._client.close() @@ -43,3 +46,6 @@ class SSHConnection: return self def __exit__(self, exc_type, exc_value, traceback): self.close() + + def __str__(self): + return 'ssh:%s' % str(self._remote) |