diff options
author | Tomás Touceda <chiiph@leap.se> | 2013-06-28 14:25:19 -0300 |
---|---|---|
committer | Tomás Touceda <chiiph@leap.se> | 2013-06-28 14:25:19 -0300 |
commit | 5b975799ce9b7a6e0a88be4bcb48bdfb90800bb3 (patch) | |
tree | bda674a79b1aeccb37b67609517bc4761db7ae07 /src/leap/eip/udstelnet.py | |
parent | 9cea9c8a34343f8792d65b96f93ae22bd8685878 (diff) | |
parent | c088a1544a5f7a51359d2802019c0740aab0cc5b (diff) |
Merge branch 'release-0.2.2'0.2.2
Diffstat (limited to 'src/leap/eip/udstelnet.py')
-rw-r--r-- | src/leap/eip/udstelnet.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/src/leap/eip/udstelnet.py b/src/leap/eip/udstelnet.py deleted file mode 100644 index 18e927c2..00000000 --- a/src/leap/eip/udstelnet.py +++ /dev/null @@ -1,38 +0,0 @@ -import os -import socket -import telnetlib - -from leap.eip import exceptions as eip_exceptions - - -class UDSTelnet(telnetlib.Telnet): - """ - a telnet-alike class, that can listen - on unix domain sockets - """ - - def open(self, host, port=23, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): - """Connect to a host. If port is 'unix', it - will open a connection over unix docmain sockets. - - The optional second argument is the port number, which - defaults to the standard telnet port (23). - - Don't try to reopen an already connected instance. - """ - self.eof = 0 - self.host = host - self.port = port - self.timeout = timeout - - if self.port == "unix": - # unix sockets spoken - if not os.path.exists(self.host): - raise eip_exceptions.MissingSocketError - self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) - try: - self.sock.connect(self.host) - except socket.error: - raise eip_exceptions.ConnectionRefusedError - else: - self.sock = socket.create_connection((host, port), timeout) |