1   
  2   
  3   
  4   
  5   
  6   
  7   
  8   
  9   
 10   
 11   
 12   
 13   
 14   
 15   
 16   
 17   
 18   
 19  """ 
 20  Exceptions defined by paramiko. 
 21  """ 
 22   
 23   
 25      """ 
 26      Exception raised by failures in SSH2 protocol negotiation or logic errors. 
 27      """ 
 28      pass 
  29   
 30   
 32      """ 
 33      Exception raised when authentication failed for some reason.  It may be 
 34      possible to retry with different credentials.  (Other classes specify more 
 35      specific reasons.) 
 36       
 37      @since: 1.6 
 38      """ 
 39      pass 
  40       
 41   
 43      """ 
 44      Exception raised when a password is needed to unlock a private key file. 
 45      """ 
 46      pass 
  47   
 48   
 50      """ 
 51      Exception raised when an authentication type (like password) is used, but 
 52      the server isn't allowing that type.  (It may only allow public-key, for 
 53      example.) 
 54       
 55      @ivar allowed_types: list of allowed authentication types provided by the 
 56          server (possible values are: C{"none"}, C{"password"}, and 
 57          C{"publickey"}). 
 58      @type allowed_types: list 
 59       
 60      @since: 1.1 
 61      """ 
 62      allowed_types = [] 
 63       
 67        
  70   
 71   
 73      """ 
 74      An internal exception thrown in the case of partial authentication. 
 75      """ 
 76      allowed_types = [] 
 77       
  81   
 82   
 84      """ 
 85      Exception raised when an attempt to open a new L{Channel} fails. 
 86       
 87      @ivar code: the error code returned by the server 
 88      @type code: int 
 89       
 90      @since: 1.6 
 91      """ 
  95   
 96   
 98      """ 
 99      The host key given by the SSH server did not match what we were expecting. 
100       
101      @ivar hostname: the hostname of the SSH server 
102      @type hostname: str 
103      @ivar key: the host key presented by the server 
104      @type key: L{PKey} 
105      @ivar expected_key: the host key expected 
106      @type expected_key: L{PKey} 
107       
108      @since: 1.6 
109      """ 
110 -    def __init__(self, hostname, got_key, expected_key): 
 111          SSHException.__init__(self, 'Host key for server %s does not match!' % hostname) 
112          self.hostname = hostname 
113          self.key = got_key 
114          self.expected_key = expected_key 
  115