o
    VÇòf€  ã                   @   sR   d Z ddlZddlmZ ddlmZ e e¡ZG dd„ deƒZ	G dd„ deƒZ
dS )	zåSpecial cased retries.

These are additional retry cases we still have to handle from the legacy
retry handler.  They don't make sense as part of the standard mode retry
module.  Ideally we should be able to remove this module.

é    N)Úcrc32)ÚBaseRetryableCheckerc                   @   s   e Zd ZdZdd„ ZdS )ÚRetryIDPCommunicationErrorÚstsc                 C   s(   |j jj}|| jkrdS | ¡ }|dkS )NFÚIDPCommunicationError)Úoperation_modelÚservice_modelÚservice_nameÚ_SERVICE_NAMEÚget_error_code)ÚselfÚcontextr	   Ú
error_code© r   úY/home/ubuntu/oakencloud.com/venv/lib/python3.10/site-packages/botocore/retries/special.pyÚis_retryable   s
   

z'RetryIDPCommunicationError.is_retryableN)Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r      s    r   c                   @   s   e Zd ZdZdZdd„ ZdS )ÚRetryDDBChecksumErrorzx-amz-crc32Údynamodbc                 C   st   |j jj}|| jkrdS |jd u rdS |jj | j¡}|d u r!dS t|jj	ƒd@ }|t
|ƒkr8t d||¡ dS d S )NFl   ÿÿ z@DynamoDB crc32 checksum does not match, expected: %s, actual: %sT)r   r   r	   r
   Úhttp_responseÚheadersÚgetÚ_CHECKSUM_HEADERr   ÚcontentÚintÚloggerÚdebug)r   r   r	   ÚchecksumÚactual_crc32r   r   r   r   "   s"   


üùz"RetryDDBChecksumError.is_retryableN)r   r   r   r   r
   r   r   r   r   r   r      s    r   )Ú__doc__ÚloggingÚbinasciir   Úbotocore.retries.baser   Ú	getLoggerr   r   r   r   r   r   r   r   Ú<module>   s    
