U vfF@sddlZGdddeZGdddeZGdddeZGdd d eZGd d d eZGd d d eZGdddeZGdddeZ GdddeZ GdddeZ Gdddej Z GdddeZGdddeZGdddeZdS)Nc@seZdZdZdS) SSHExceptionzT Exception raised by failures in SSH2 protocol negotiation or logic errors. N__name__ __module__ __qualname____doc__rrG/opt/alt/python38/lib/python3.8/site-packages/paramiko/ssh_exception.pyrsrc@seZdZdZdS)AuthenticationExceptionz Exception raised when authentication failed for some reason. It may be possible to retry with different credentials. (Other classes specify more specific reasons.) .. versionadded:: 1.6 Nrrrrr r sr c@seZdZdZdS)PasswordRequiredExceptionzR Exception raised when a password is needed to unlock a private key file. Nrrrrr r *sr c@s$eZdZdZgZddZddZdS)BadAuthenticationTypez Exception raised when an authentication type (like password) is used, but the server isn't allowing that type. (It may only allow public-key, for example.) .. versionadded:: 1.1 cCst|||||_||_dSN)r __init__ explanation allowed_types)selfrtypesrrr r>szBadAuthenticationType.__init__cCsd|j|jS)Nz{}; allowed types: {!r})formatrrrrrr __str__EszBadAuthenticationType.__str__Nrrrrrrrrrrr r 2sr c@s$eZdZdZgZddZddZdS)PartialAuthenticationzM An internal exception thrown in the case of partial authentication. cCst||||_dSr )r rr)rrrrr rRs zPartialAuthentication.__init__cCs d|jS)Nz+Partial authentication; allowed types: {!r})rrrrrr rVszPartialAuthentication.__str__Nrrrrr rKsrc@s eZdZdS)UnableToAuthenticateN)rrrrrrr r]src@s eZdZdZddZddZdS)ChannelExceptionz Exception raised when an attempt to open a new `.Channel` fails. :param int code: the error code returned by the server .. versionadded:: 1.6 cCst|||||_||_dSr )rrcodetext)rrrrrr rjszChannelException.__init__cCsd|j|jS)NzChannelException({!r}, {!r}))rrrrrrr roszChannelException.__str__Nrrrrrrrrrr rasrc@s eZdZdZddZddZdS)BadHostKeyExceptiona The host key given by the SSH server did not match what we were expecting. :param str hostname: the hostname of the SSH server :param PKey got_key: the host key presented by the server :param PKey expected_key: the host key expected .. versionadded:: 1.6 cCs&t||||||_||_||_dSr )rrhostnamekey expected_key)rrZgot_keyr rrr r~szBadHostKeyException.__init__cCs d}||j|j|jS)Nz@Host key for server '{}' does not match: got '{}', expected '{}')rrrZ get_base64r )rmsgrrr rs zBadHostKeyException.__str__Nrrrrr rss rc@seZdZdZdS)IncompatiblePeerzk A disagreement arose regarding an algorithm required for key exchange. .. versionadded:: 2.9 Nrrrrr r"s r"c@s eZdZdZddZddZdS)ProxyCommandFailurez The "ProxyCommand" found in the .ssh/config file returned an error. :param str command: The command line that is generating this exception. :param str error: The error captured from the proxy command output. cCst|||||_||_dSr )rrcommanderror)rr$r%rrr rszProxyCommandFailure.__init__cCsd|j|jS)Nz3ProxyCommand("{}") returned nonzero exit status: {})rr$r%rrrr rszProxyCommandFailure.__str__Nrrrrr r#sr#cs(eZdZdZfddZddZZS)NoValidConnectionsErrora Multiple connection attempts were made and no families succeeded. This exception class wraps multiple "real" underlying connection errors, all of which represent failed connection attempts. Because these errors are not guaranteed to all be of the same error type (i.e. different errno, `socket.error` subclass, message, etc) we expose a single unified error message and a ``None`` errno so that instances of this class match most normal handling of `socket.error` objects. To see the wrapped exception objects, access the ``errors`` attribute. ``errors`` is a dict whose keys are address tuples (e.g. ``('127.0.0.1', 22)``) and whose values are the exception encountered trying to connect to that address. It is implied/assumed that all the errors given to a single instance of this class are from connecting to the same hostname + port (and thus that the differences are in the resolution of the hostname - e.g. IPv4 vs v6). .. versionadded:: 1.16 cslt|}ddd|ddD}|dd}|r>d}nd}td||dd ||||_dS) zl :param dict errors: The errors dict to store, as described by class docstring. z, cSsg|] }|dqS)rr).0xrrr sz4NoValidConnectionsError.__init__..Nrz+Unable to connect to port {0} on {1} or {2}z$Unable to connect to port {0} on {2})sortedkeysjoinsuperrrerrors)rr0addrsbodytailr! __class__rr rs  z NoValidConnectionsError.__init__cCs|j|jffSr )r5r0rrrr __reduce__sz"NoValidConnectionsError.__reduce__)rrrrrr6 __classcell__rrr4r r&s r&c@seZdZdZdS)CouldNotCanonicalizezh Raised when hostname canonicalization fails & fallback is disabled. .. versionadded:: 2.7 Nrrrrr r8sr8c@seZdZdZdS)ConfigParseErrora@ A fatal error was encountered trying to parse SSH config data. Typically this means a config file violated the ``ssh_config`` specification in a manner that requires exiting immediately, such as not matching ``key = value`` syntax or misusing certain ``Match`` keywords. .. versionadded:: 2.7 Nrrrrr r9s r9c@seZdZdZdS)MessageOrderErrorzo Out-of-order protocol messages were received, violating "strict kex" mode. .. versionadded:: 3.4 Nrrrrr r:sr:)socket Exceptionrr r r rrrrr"r#r%r&r8r9r:rrrr s ,