Submit
Path:
~
/
/
proc
/
thread-self
/
root
/
usr
/
lib
/
python2.7
/
site-packages
/
awscli
/
customizations
/
cloudformation
/
File Content:
s3uploader.pyc
� =��Xc @ s� d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l m Z d d l m Z d d l m Z e j e � Z d e f d � � YZ d e f d � � YZ d S( i����N( t TransferManager( t BaseSubscriber( t exceptionst S3Uploaderc B s_ e Z d Z d d e d d � Z d � Z d d � Z d � Z d � Z d � Z d d � Z RS( s� Class to upload objects to S3 bucket that use versioning. If bucket does not already use versioning, this class will turn on versioning. c C sd | | _ | | _ | p d | _ | | _ | | _ | | _ | | _ | s` t | j � | _ n d S( N( t bucket_namet prefixt Nonet kms_key_idt force_uploadt s3t regiont transfer_managerR ( t selft s3_clientR R R R R R ( ( sO /tmp/pip-build-uEGWVr/awscli/awscli/customizations/cloudformation/s3uploader.pyt __init__$ s c C sK | j r6 t | j � d k r6 d j | j | � } n | j rr | j | � rr t j d j | � � | j | � Sy~ i d d 6} | j r� d | d <| j | d <n t | | � } | j j | | j | | | g � } | j � | j | � SWnT t j j k rF} | j d d } | d k r=t j d | j � � n | � n Xd S( s� Uploads given file to S3 :param file_name: Path to the file that will be uploaded :param remote_path: be uploaded :return: VersionId of the latest upload i s {0}/{1}s= File with same data is already exists at {0}. Skipping uploadt AES256t ServerSideEncryptions aws:kmst SSEKMSKeyIdt Errort Codet NoSuchBucketR N( R t lent formatR t file_existst LOGt debugt make_urlR t ProgressPercentageR t uploadR t resultt botocoreR t ClientErrort responset NoSuchBucketError( R t file_namet remote_patht additional_argst print_progress_callbackt futuret ext error_code( ( sO /tmp/pip-build-uEGWVr/awscli/awscli/customizations/cloudformation/s3uploader.pyR 6 s4 c C s<