o
    .&ßa;  ã                   @   s`   d dl Z d dlZd dlmZ d dlmZ e e¡Ze j	 
e j	 dddd¡¡Zdd	„ Zd
d„ ZdS )é    N)ÚProfileNotFound)ÚJSONFileCacheú~z.awsÚcliÚcachec                 C   s   | j dtdd� d S )Nzsession-initializedÚ&inject_assume_role_cred_provider_cache)Ú	unique_id)ÚregisterÚ!inject_assume_role_provider_cache)Úevent_handlers© r   úB/usr/lib/python3/dist-packages/awscli/customizations/assumerole.pyÚregister_assume_role_provider   s   
þr   c                 K   sZ   z|   d¡}W n ty   t d¡ Y d S w | d¡}ttƒ|_| d¡}ttƒ|_d S )NÚcredential_providerz}ProfileNotFound caught when trying to inject assume-role cred provider cache.  Not configuring JSONFileCache for assume-role.zassume-rolezassume-role-with-web-identity)Úget_componentr   ÚLOGÚdebugÚget_providerr   Ú	CACHE_DIRr   )ÚsessionÚkwargsÚ
cred_chainÚassume_role_providerÚweb_identity_providerr   r   r   r
      s   
í

ÿr
   )ÚosÚloggingÚbotocore.exceptionsr   Úbotocore.credentialsr   Ú	getLoggerÚ__name__r   ÚpathÚ
expanduserÚjoinr   r   r
   r   r   r   r   Ú<module>   s    
