diff options
author | Anton Khirnov <anton@khirnov.net> | 2020-02-15 11:05:43 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2020-02-15 11:05:43 +0100 |
commit | 00bf9f3eafff6f29b4fcf18d7c1f2ab2b1310c16 (patch) | |
tree | b5430fa827e48b6e42e3f49a1b4e188675bef6d3 /lbup/ssh_remote.py | |
parent | 1c33c917bbcad2924bb722f77c7aaa4f511a299c (diff) |
Rename bupper to lbup.
bupper already exists.
lbup is a randomly chosen word containing bup
Diffstat (limited to 'lbup/ssh_remote.py')
-rw-r--r-- | lbup/ssh_remote.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lbup/ssh_remote.py b/lbup/ssh_remote.py new file mode 100644 index 0000000..634c86a --- /dev/null +++ b/lbup/ssh_remote.py @@ -0,0 +1,25 @@ +class SSHRemote: + """ + Specification of an SSH remote host, represented by a combination of host, + port and username, plus an optional proxy remote. + :param str host: + :param int port: + :param str username: + :param SSHRemote proxy_remote: proxy through which the connection should be + tunnelled + """ + host = None + port = None + username = None + proxy_remote = None + def __init__(self, host, port, username, proxy_remote = None): + self.host = host + self.port = port + self.username = username + self.proxy_remote = proxy_remote + def __str__(self): + return '{user}@{host}:{port}{proxy}'.format( + user = self.username, + host = self.host, + port = self.port, + proxy = '@@{%s}' % str(self.proxy_remote) if self.proxy_remote else '') |