
    #	                     
   d Z ddlmZ ddlmZ ddlmZ ddlmZ  G d dej                        Z G d d	ej                        Z	 G d
 dej                        Z
 G d dej                        Z G d dej                        Zy)z&Exceptions for Cloud TPU VM libraries.    )absolute_import)division)unicode_literals)
exceptionsc                   "     e Zd ZdZ fdZ xZS )TPUInUnusableTerminalStatez5Error when the TPU is in an unusable, terminal state.c                 J    t         t        |   dj                  |             y )Nz?This TPU has terminal state "{}", so it cannot be used anymore.)superr   __init__formatselfstate	__class__s     @lib/googlecloudsdk/command_lib/compute/tpus/tpu_vm/exceptions.pyr   z#TPUInUnusableTerminalState.__init__   s    	
$d4I	    __name__
__module____qualname____doc__r   __classcell__r   s   @r   r   r      s    = r   r   c                   "     e Zd ZdZ fdZ xZS )TPUInUnusableStatez+Error when the TPU is in an unusable state.c                 J    t         t        |   dj                  |             y )Nz@This TPU has state "{}", so it cannot be currently connected to.)r
   r   r   r   r   s     r   r   zTPUInUnusableState.__init__$   s    	
d,J	r   r   r   s   @r   r   r   !   s    3 r   r   c                   "     e Zd ZdZ fdZ xZS )SSHKeyNotInAgentz/Error when the SSH key is not in the SSH agent.c                 J    t         t        |   dj                  |             y )NzZSSH Key is not present in the SSH agent. Please run "ssh-add {}" to add it, and try again.)r
   r   r   r   )r   identity_filer   s     r   r   zSSHKeyNotInAgent.__init__-   s"    	
D*	!!'!68r   r   r   s   @r   r   r   *   s    78 8r   r   c                   "     e Zd ZdZ fdZ xZS )IapTunnelingUnavailablezDError when IAP tunneling is unavailable (either temporarily or not).c                 ,    t         t        |   d       y )Nz<Currently unable to connect to this TPU using IAP tunneling.)r
   r"   r   r   r   s    r   r   z IapTunnelingUnavailable.__init__6   s    	
!41FHr   r   r   s   @r   r"   r"   3   s    LH Hr   r"   c                   "     e Zd ZdZ fdZ xZS )TPUInMaintenanceEventz4Error when TPU has unhealthy maintenance for health.c                 ,    t         t        |   d       y )NzThis TPU is going through a maintenance event, and is currently unavailable. For more information, see https://cloud.google.com/tpu/docs/maintenance-events.)r
   r&   r   r$   s    r   r   zTPUInMaintenanceEvent.__init__>   s    	
/ 	gr   r   r   s   @r   r&   r&   ;   s    < r   r&   N)r   
__future__r   r   r   googlecloudsdk.corer   Errorr   r   r   r"   r&    r   r   <module>r,      sr    - &  ' *!1!1 )) 8z'' 8Hj.. HJ,, r   