U
    i©¹dC  ã                   @   sò   G d d„ de ƒZG dd„ de ƒZG dd„ de ƒZG dd„ de ƒZG dd	„ d	e ƒZG d
d„ de ƒZG dd„ de ƒZG dd„ de ƒZG dd„ de ƒZ	G dd„ de ƒZ
G dd„ de ƒZG dd„ de ƒZG dd„ de ƒZddd	ddddddddddgZdS )c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚInvalidPasswordExceptionz@Raised when the provided password is rejected by the remote hostc                    s   d}t t| ƒ |¡ d S )NzInvalid password provided)Úsuperr   Ú__init__©ÚselfÚmessage©Ú	__class__© ú:/usr/lib/python3/dist-packages/sos/collector/exceptions.pyr      s    z!InvalidPasswordException.__init__©Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú__classcell__r	   r	   r   r
   r      s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚTimeoutPasswordAuthExceptionzLRaised when a timeout is hit waiting for an auth reply using a password
    c                    s   d}t t| ƒ |¡ d S )Nz1Timeout hit while waiting for password validation)r   r   r   r   r   r	   r
   r      s    z%TimeoutPasswordAuthException.__init__r   r	   r	   r   r
   r      s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚPasswordRequestExceptionzMRaised when the remote host requests a password that was not anticipated
    c                    s   d}t t| ƒ |¡ d S )Nz*Host requested password, but none provided)r   r   r   r   r   r	   r
   r   !   s    z!PasswordRequestException.__init__r   r	   r	   r   r
   r      s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚAuthPermissionDeniedExceptionz=Raised when authentication attempts return a permission errorc                    s   d}t t| ƒ |¡ d S )Nz.Permission denied while trying to authenticate)r   r   r   r   r   r	   r
   r   )   s    z&AuthPermissionDeniedException.__init__r   r	   r	   r   r
   r   &   s   r   c                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚConnectionExceptionz'Raised when an attempt to connect failsÚ c                    s    d||f }t t| ƒ |¡ d S )Nz1Could not connect to host %s on specified port %s)r   r   r   )r   ZaddressZportr   r   r	   r
   r   1   s    ÿzConnectionException.__init__)r   r   r   r	   r	   r   r
   r   .   s   r   c                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚCommandTimeoutExceptionzRaised when a timeout expiresNc                    s(   d}|r|d| 7 }t t| ƒ |¡ d S )NzTimeout expiredz executing %s)r   r   r   )r   Zcommandr   r   r	   r
   r   :   s    z CommandTimeoutException.__init__)Nr   r	   r	   r   r
   r   7   s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚConnectionTimeoutExceptionzARaised when a timeout expires while trying to connect to the hostc                    s   d}t t| ƒ |¡ d S )Nz'Timeout expires while trying to connect)r   r   r   r   r   r	   r
   r   D   s    z#ConnectionTimeoutException.__init__r   r	   r	   r   r
   r   A   s   r   c                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚControlSocketMissingExceptionz-Raised when the SSH control socket is missingr   c                    s   d| }t t| ƒ |¡ d S )Nz$SSH control socket %s does not exist)r   r   r   )r   Úpathr   r   r	   r
   r   L   s    z&ControlSocketMissingException.__init__)r   r   r	   r	   r   r
   r   I   s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )Ú"ControlPersistUnsupportedExceptionz5Raised when SSH ControlPersist is unsupported locallyc                    s   d}t t| ƒ |¡ d S )Nz4ControlPersist unsupported by local SSH installation)r   r   r   r   r   r	   r
   r   T   s    z+ControlPersistUnsupportedException.__init__r   r	   r	   r   r
   r   Q   s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚUnsupportedHostExceptionz8Raised when the host type is unsupported or undeterminedc                    s   d}t t| ƒ |¡ d S )Nz.Host did not match any supported distributions)r   r   r   r   r   r	   r
   r   \   s    z!UnsupportedHostException.__init__r   r	   r	   r   r
   r   Y   s   r   c                       s"   e Zd ZdZd‡ fdd„	Z‡  ZS )ÚInvalidTransportExceptionzZRaised when a transport is requested but it does not exist or is
    not supported locallyNc                    s$   |rd| nd}t t| ƒ |¡ d S )Nz6Connection failed: unknown or unsupported transport %sr   )r   r   r   )r   Z	transportr   r   r	   r
   r   e   s    ÿÿÿz"InvalidTransportException.__init__)Nr   r	   r	   r   r
   r   a   s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )Ú#SaltStackMasterUnsupportedExceptionz3Raised when SaltStack Master is unsupported locallyc                    s   d}t t| ƒ |¡ d S )Nz2Master unsupported by local SaltStack installation)r   r   r   r   r   r	   r
   r   n   s    z,SaltStackMasterUnsupportedException.__init__r   r	   r	   r   r
   r   k   s   r   c                       s    e Zd ZdZ‡ fdd„Z‡  ZS )ÚJujuNotInstalledExceptionz)Raised when juju is not installed locallyc                    s   d}t t| ƒ |¡ d S )Nz=Juju is not installed, please ensure you have installed juju.)r   r   r   r   r   r	   r
   r   v   s    ÿz"JujuNotInstalledException.__init__r   r	   r	   r   r
   r   s   s   r   N)Ú	Exceptionr   r   r   r   r   r   r   r   r   r   r   r   r   Ú__all__r	   r	   r	   r
   Ú<module>   s4   			

ó