Revision 94265508 ncclient/transport/errors.py

b/ncclient/transport/errors.py
14 14

  
15 15
from ncclient import TransportError
16 16

  
17
class SessionCloseError(TransportError):
18
    
19
    def __init__(self, in_buf, out_buf=None):
20
        msg = 'Unexpected session close.'
21
        if in_buf:
22
            msg += '.. IN_BUFFER: |%s| ' % in_buf
23
        if out_buf:
24
            msg += '.. OUT_BUFFER: |%s|' % out_buf
25
        SSHError.__init__(self, msg)
26

  
17 27
class SSHError(TransportError):
18 28
    pass
19 29

  
......
28 38
                 % (hexlify(key.get_fingerprint()), hostname))
29 39
        self.hostname = hostname
30 40
        self.key = key
31
    
32
class SSHSessionClosedError(SSHError):
33
    
34
    def __init__(self, in_buf, out_buf=None):
35
        msg = 'Unexpected session close.'
36
        if in_buf:
37
            msg += '\nIN_BUFFER: %s' % in_buf
38
        if out_buf:
39
            msg += '\nOUT_BUFFER: %s' % out_buf
40
        SSHError.__init__(self, msg)

Also available in: Unified diff