Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
python3-s3fuse-plugin / usr / lib / python3.6 / site-packages / s3fuse / __pycache__ / vaults3.cpython-36.opt-1.pyc
Size: Mime:
3

©Dg¬¯ã@sŠdZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZdZdZ
dZdZejeƒZd	d
„ZGdd„deƒZdS)
z Trilio S3 Backend implimentation

    This module contains the back end implimentation of all of all S3 specific
    support.
éN)ÚClientError)Úget_retention_modeÚs3ièz$80bc80ff-0c51-4534-86a2-ec5e719643c2iôcCs&|jdd}|tjdddƒjƒ}|S)zè Utility function used to convert a datetime to an OS timestamp.

    Args:
        modified_time (datetime): Datatime object to convert to a Unix Epoc timestamp.

    Returns:
        The value of modified_time as a timestamp.
    N)Ztzinfoi²é)ÚreplaceÚdatetimeZ
total_seconds)Z
modified_timeZ
naive_timeZ
delta_seconds©rú/usr/lib/python3.6/vaults3.pyÚ_make_timestamp"s	r
c@sÞeZdZdZdd„Zdd„Zdd„Zdd	„Zd
d„Zdd
„Z	dd„Z
d7dd„Zdd„Zdd„Z
dd„Zdd„Zdd„Zd8dd „Zd!d"„Zd9d#d$„Zd%d&„Zd'd(„Zd)d*„Zd+d,„Zd-d.„Zd/d0„Zd1d2„Zd3d4„Zd5d6„ZdS):Ú	S3Backendz´ S3 Backend implimentation.

    A Wrapper for the AWS S3 boto3 and botocore API. This class encapsulates all S3
    operations and exposes them as a backend storage instance.
    c
Csdd}d}||_|jdƒr&t|jdƒƒnt}|ddkrVtjj|dt|dƒ|d}ntjjt|dƒ|d}|ds²tjd|d	d
|d|d|d	d
||d|dd}n||ddkrútjd|d	d
|d|d|d	d
||d|dd}n4tjd|d	d
|d|d|d	d
||dd}dd„}|jj	j
d|ƒ||_|d|_|d|_
dS)NZvault_s3_max_pool_connectionsZs3_signatureÚdefaultZs3_read_timeout)Zsignature_versionÚread_timeoutÚmax_pool_connections)r
rZ
s3_ssl_verifyrZ
os_optionsÚregion_nameÚuserÚkeyZobject_storage_urlZs3_ssl)rÚaws_access_key_idÚaws_secret_access_keyÚendpoint_urlÚconfigÚuse_sslZverifyZs3_ssl_certÚ)rrrrrrc[sd|jd<dS)Nz
keep-aliveZ
Connection)Úheaders)ZrequestZoperation_nameÚkwargsrrr	Úset_connection_header\sz1S3Backend.__init__.<locals>.set_connection_headerzrequest-created.s3ÚbucketÚretention_mode)ÚoptionsÚgetÚintÚDEFAULT_MAX_POOL_SIZEÚbotocoreZclientZConfigÚboto3ÚmetaZeventsÚregisterÚ_S3Backend__clientÚ_S3Backend__bucket_nameÚ_S3Backend__retention_mode)ÚselfrZ
config_objectZ	s3_clientZ
MAX_POOL_SIZErrrr	Ú__init__8sH








zS3Backend.__init__cCs(t|j|d|dƒ|d<|d|_dS)NrÚbucket_object_lockr)rr%r')r(rrrr	Úset_retention_modedszS3Backend.set_retention_modecCs"y|jj|jdy‚|jj|jd}|drP|jdiƒjdƒdkrPtd|ƒ‚|dr||jdiƒjdƒdkr|td|ƒ‚|dr”|ds”td	ƒ‚Wn,tk
rÂ}z|dr²‚WYd
d
}~XnX|dstjjddd
ddddƒ}|jj	|j|dd|jj
|j|dWn‚YnXd
S)af Validates the S3 credentials / permission on the provided bucket.
            It also validates against s3 object lock configuration and if the s3 supports
            more than 255 object name length
        Args:
            self : S3 Backend object
        Returns:
            Does not return anything, But raises exception if validation fails.
        )ÚBucketr*ZObjectLockConfigurationZObjectLockEnabledZEnabledzZConfigration says object lock enabled on the bucket, but s3 API does not agree with it. %sz[Configration says object lock disabled on the bucket, but s3 API does not agree with it. %sÚuse_manifest_suffixzR'use_manifest_suffix' must be set to True when 'bucket_object_lock' is set to TrueNztvault_config/z.workload_f5190be6-7f80-4856-8c24-149cb40500c5/z.snapshot_f2e5c6a7-3c21-4b7f-969c-915bb408c64f/z+vm_id_e81d1ac8-b49a-4ccf-9d92-5f1ef358f1be/z3vm_res_id_72477d99-c475-4a5d-90ae-2560f5f3b319_vda/z.deac2b8a-dca9-4415-adc1-f3c6598204ed-segments/z0000000000000000.00000000z	Test Data)r,ÚKeyÚBody)r,r.)r%Zhead_bucketr&Zget_object_lock_configurationrÚ	ExceptionÚosÚpathÚjoinÚ
put_objectÚ
delete_object)r(rZobj_lock_cfgÚexZlong_keyrrr	Úvalidate_s3_clientis@	

zS3Backend.validate_s3_clientcCsÌy°xªt|ƒdkr¬g}|dt…}x0|D](}|jdƒr@|dd…}|jd|iƒq&Wy|jj|jd|idWn0x"|D]}|jj|j|ddqzWYnX|td…}qWWntk
rÆ‚YnXdS)	zß Utility method that takes a list of objects and puts it in the correct format
            for the S3 delete_objects() API.

        Args:
            object_list (list): A list of objects with the correct S3 path.
        rNú/rr.ÚObjects)r,ÚDelete)r,r.)	ÚlenÚMAX_S3_PAGE_SIZEÚ
startswithÚappendr%Údelete_objectsr&r5r)r(Úobject_listZobject_delete_listZ	list_partÚobjrrr	Z__delete_object_list›s$




zS3Backend.__delete_object_listcCs˜y|g}|jjdƒ}|j|j|d}xL|D]D}d|kr(|jdt|dƒƒdkr(x|dD]}|j|dƒqVWq(W|j|ƒWntk
r’‚YnXdS)z‘ Utility method used to perform a rmdir operation on an object hierarchy

        Args:
            object_tree (str): Object/Tree path.
        Úlist_objects)r,ÚPrefixÚContentsÚKeyCountrr.N)	r%Ú
get_paginatorÚpaginater&rr;r>Ú_S3Backend__delete_object_listr)r(Úobject_treer@Úlist_paginatorÚ
page_iteratorÚobjectsrArrr	Z__delete_object_tree¹s
 zS3Backend.__delete_object_treecCs|j|ƒdS)zó Delete a list of objects.

        Args:
            object_list (list): List of objects. Each with a full object path
                                in correct format.
            options (dic): Dictionary of configuration options.
        N)rH)r(r@rrrr	Údelete_object_listÏszS3Backend.delete_object_listcCs¬y|s
dSdj|ƒ}|jdƒr*|dd…}d|krF|jj|j|dnH|jdƒd}|j|dd}|rxt|dd	d
}n|}|jj|j|dWntk
r¦‚YnXdS)a Delete an object from the S3 object store.

        The object and any segments stored in the segment directory will be
        removed.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.
        Nr8rz	-segments)r,r.z	.manifestT)Ústrict_path_filter)Úreverser)	r3r=r%r5r&ÚstriprBÚsortedr)r(ÚargsrÚobject_nameÚmanifest_prefixÚ	manifestsÚ
manifest_namerrr	r5Ùs$





zS3Backend.delete_objectrcCs¤td|ƒ}y~xxtd|ƒD]j}y|jj|j|ddStk
r€}z2|jdddkrn|d|krntjdƒw‚WYdd}~XqXqWWntk
rž‚YnXdS)a Utility method used to wait for a S3 object to become available.

        This routine will keep performing a head_object() request every second
        for "retries" number of times. This was added to work around any potential
        eventual consistancey issues when uploading to AWS.

        Args:
            object_name (str): Name of the object.
            retries (int): Optional parameter that defaults to 1.

        Returns:
            Returns when the object is available or ClientError not found exception.
        rr)r,r.NÚResponseMetadataÚHTTPStatusCodei”)	ÚmaxÚranger%Úhead_objectr&rÚresponseÚtimeÚsleep)r(rSÚretriesÚretryÚerrorrrr	Z__wait_for_objectüs


zS3Backend.__wait_for_objectc	Csòy^|jdƒd}|jdr&|jdr<|jj|j|d}n|jj|j|d}|r*|}|jdgƒpn|jdgƒ}|jdr|jj|j|d}|jdgƒp¤|jdgƒ}|rºt|dd	„d
}x\|D]T}|jj	|j|d|jdd
ƒd}|ddjddƒdkrÀt
j|dj|dƒƒSqÀW|dd}n|}|s8t
dƒ‚|jj	|j|d}t
j|dj|dƒƒStk
rì}zn|jdddkrŒ‚nPy6|j|dƒ|jj	|j|d}t
j|dj|dƒƒStk
rÚ‚YnXWYdd}~XnXdS)zÓ Download and return the object manifest as a json array.

            Args:
                object_name (str): Name of the object.

            Returns:
                Object manifest as a dictionary.
        r8z	.manifestr-r*)r,rCÚVersionsrDcSs|dS)NÚLastModifiedr)Úkrrr	Ú<lambda>7sz/S3Backend.get_object_manifest.<locals>.<lambda>)rr.Ú	VersionIdr)r,r.rfrWÚHTTPHeadersz$x-amz-meta-stamp-trilio-authenticityÚFalseÚTruer/Ú
ContentLengthrzOManifest object with 'x-amz-meta-stamp-trilio-authenticity' attribute not found)r,r.rXiӎ
Néÿÿÿÿ)rPrr%Zlist_objects_v2r&rBrÚlist_object_versionsrQÚ
get_objectÚjsonÚloadsÚreadr0rr\Ú_S3Backend__wait_for_object)	r(rSrTrUrVÚmanifests_dataÚmanifestÚresprarrr	Úget_object_manifestsT	




zS3Backend.get_object_manifestcCsÐ|jdƒd}|jdrdS|jj|j|d}|rÀ|jdgƒpH|jdgƒ}g}x|D]}|jd|diƒqTW|rÌy|jj|jd	|id
WqÌx"|D]}|jj|j|ddqšWYqÌXnt	d|ƒ‚dS)
zÓ Download and return the object manifest as a json array.

            Args:
                object_name (str): Name of the object.

            Returns:
                Object manifest as a dictionary.
        r8z	.manifestr*N)r,rCrbrDr.r9)r,r:)r,r.zManifest for %s is not found)
rPrr%rBr&rr>r?r5r0)r(rSrTrurUÚobjs_to_deleteÚmanrArrr	Údelete_object_manifestWs(





z S3Backend.delete_object_manifestcCshy8dj|ƒ}i}|jr d|ji}|jj|j||j|ƒWn*tk
rN‚Yntk
rb‚YnXdS)a? Download a file from the S3 object store.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.

        Returns:
            On success, the contents of the object are downloaded to file identidfied
            by options.out_file.
        r8rfN)r3Ú
version_idr%Z
download_filer&Zout_filerr0)r(rRrrSZ
extra_argsrrr	Údownload_objectys

zS3Backend.download_objectcCsvyFdj|ƒ}|jr*|jj|j||jd}n|jj|j|d}|djƒStk
r\‚Yntk
rp‚YnXdS)aB Get object from the S3 object store in buffer.
        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.
        Returns:
            On success, the contents of the object are downloaded to file identidfied
            by options.out_file.
        r8)r,r.rf)r,r.r/N)r3rzr%rnr&rqrr0)r(rRrrSr\rrr	rn‘s	
zS3Backend.get_objectc
Cs„yh|jdkr0|jtjj|dd|dƒ|ƒ|jdk	rf|jj|j|dd|d||dd}|SWnt	k
r~‚YnXdS)a Put an object to the S3 object store.
        Args:
            args (list): List of object name parts.
            buf: Data to upload in object.
            buf_len: Length of data to upload in object.
            options (dic): Dictionary of configuration options.
        Frr8rSNzapplication/octet-stream)r,r.rjr/ÚContentType)
Ú
path_validÚ_S3Backend__create_folderr1r2ÚdirnamerSr%r4r&r)r(rRZbufZbuf_lenrrurrr	r4«s


zS3Backend.put_objectNFcCsRtƒ}|jdƒ}y"t}|dk	r,|tkr,|}|jdrD|jjdƒ}n|jjdƒ}|j|j|dd|id}xÂ|D]¸}d|ko”|jd	t	|dƒƒd
krxh|dD]\}	|dk	rÂt	|ƒ|krÂt
|ƒS|	djdƒ}
|rà|j|
ƒq¢d|
kr¢|j|
j
dd
ƒd
ƒq¢Wd|krš|jd	t	|dƒƒd
kršxr|dD]f}	|dk	rTt	|ƒ|krTt
|ƒS|	djdƒ}
|rt|j|
ƒn d|
kr0|j|
j
dd
ƒd
ƒq0Wd|krpx†|dD]z}|dk	rÐt	|ƒ|krÐt
|ƒS|jtƒsî|djtƒr¬|jdƒr|j|djdƒƒn|j|djdƒƒq¬WqpWt
|ƒStk
rL‚YnXdS)ae Return a list of objects based on the provided prefix.

        Used to generate a directory listing based on a prefix path
        constructed from the object parts in prefix

        Args:
            prefix (string): prefix of the object path. If the prefix is terminated 
                by "/", then it lists the contents in the "subdir". If the prefix
                is not terminated by "/", then it lists the contents in the current
                directory that matches the prefix
                Ex:
                    case 1:
                    =======
                    prefix - /a/b/c
                    object store has objects - /a/b/c, /a/b/c1, /a/b/d
                    return values - /a/b/c and /a/b/c1

                    case 2:
                    =======
                    prefix - /a/b/c/
                    object store has objects - /a/b/c/d, /a/b/c1, /a/b/c/e
                    return values - /a/b/c/d and /a/b/c/e
            options (dic): Dictionary of configuration options
            max_items (int): Maximum number of objects in a list query. Default is
                unlimited but when testing for an empty directory a smaller
                number can be used to limit the query and size of the list that
                is returned.
            strict_path_filter (bool): Defaults to True in order to only return
                objects with the exact same prefix. Individual segment listings
                set this to False in order to get a match on the segment offset.

        Returns:
            On success a list of unique items to be used as a directory listing.
        r8Nr*rmrBZPageSize)r,rCÚ	DelimiterZPaginationConfigrDrErr.z	.manifestrrbÚCommonPrefixesrC)ÚsetÚlstripr<rr%rFrGr&rr;ÚlistÚrstripÚaddÚsplitr=Ú_SEGMENT_PREFIXÚendswithrPr)r(ÚprefixZ	max_itemsrNZ
object_setZ	page_sizerJrKrLÚitemrSZ
object_prefixrrr	rBÇsX#

"$
zS3Backend.list_objectscCsHy,g}tjjdj|ƒ|jƒ}|j|dd}|Stk
rB‚YnXdS)a& Returns a list of object segments based on a prefix.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.

        Returns:
            A list of segments in the object store that match the supplied prefix.
        r8T)rNN)r1r2r3rŠrBr)r(rRrZsegment_listZ
segments_pathr@rrr	Ú
list_segments+s

zS3Backend.list_segmentsc/Csžtd|ƒ}ytxltd|ƒD]\}y|jj|j|d}|Stk
rx}z |jdddkrfy,|jj|j|dd}|jdƒp†d	|d<|Stk
rd}z¶|jdddkrRd
|kr8y|jdƒd}|j	drv|jj
|j|d
}|jdgƒp
|jdgƒ}|r"t|dd„d}xL|D]D}|jj|j|d|jddƒd}|ddjddƒdkr(|Sq(W|‚nj|jj|j|d
}	|	jdgƒp |	jdgƒ}	t|	dd„d}	|	rÆ|	dd}
n|}
|jj|j|
d}|SWnTtk
r6}z6|jdddkr$|d|kr$t
jdƒw‚WYdd}~XnX|d|krRt
jdƒw‚WYdd}~XnX‚WYdd}~XqXqWWntk
r˜‚YnXdS)a= Utility method that gets an object head from the repository with retry support.

        The default is to try once. Admittedly, this is ugly because the
        provided object name might be a terminal object or a "directory" so
        we need to try both cases for each retry attempt. When retry > 1, there is
        a 1 second delay between attempts.

        Args:
            object_name (str): Name of the object.
            retries (int): Optional parameter, default is 1 attempt.

        Returns:
            Object head dictionary or Boto3 exception.
        rr)r,r.rWrXi”r8r|zapplication/x-directoryz	-segmentsz	.manifestr*)r,rCrbrDcSs|dS)Nrcr)rdrrr	reisz0S3Backend.__get_object_headers.<locals>.<lambda>)rr.rfr)r,r.rfrgz$x-amz-meta-stamp-trilio-authenticityrhricSs|dS)Nrcr)rdrrr	reysNrl)rYrZr%r[r&rr\rrPrrmrQrBr]r^)r(rSr_r`Úobj_headersrarTrsrtrUrVrrr	Z__get_object_headers@sx








zS3Backend.__get_object_headerscCsdddddœ}i|d<i|dd<dj|ƒ}yÒ|sJttjjƒƒ|d<|Sy|j|ƒ}Wn†tk
rÞ}zj|jj|jd|d	}d
|krÌ|ddd„|d
DƒkrÈtjj	|d
dddƒ}d|idœ}q΂n‚WYdd}~XnXt|dƒ|d<||d<|j
ddƒdks|ddkr d|d<xX|ddjƒD]D\}	}
d|	jƒkrd|
|d|	jƒj
dƒd<n|
|d|	jƒ<q2Wt|ddj
ddƒƒdkr²|ddj
ddƒ|d<n<t|dj
ddƒƒdkrâ|dj
d dƒ|d<n|d|d<|d|d!<|SWntk
r‚YnXdS)"a) Get "operating system like" stat data for the given object.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.

        Returns:
            A stat structure containing object information required by caller.
        rrF)Ú	timestampÚsizeÚetagÚ	directoryrÚMetadatar8rŽ)r,r€rCrcSsg|]}|d‘qS)rCr)Ú.0Úxrrr	ú
<listcomp>¯sz)S3Backend.stat_object.<locals>.<listcomp>rWrgZdatez%a, %d %b %Y %H:%M:%S %Z)rjrcr’Nrcr|z
text/plainzapplication/x-directoryrjTr‘zx-object-meta-rzx-object-meta-segment-countzx-object-meta-total-sizerz
segment-countz
total-sizezx-account-bytes-used)r3r
rZnowÚ_S3Backend__get_object_headersÚ
BaseExceptionr%rBr&ZstrptimerÚitemsÚlowerr‡rr)r(rRrZ	stat_datarSZ
obj_headerr6rLZmdrÚvaluerrr	Ústat_object“s`



zS3Backend.stat_objectcCsdj|ƒ}|j||ƒdS)zÎ Create an object that represents a directory in the object store.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.
        r8N)r3r~)r(rRrZ
new_folderrrr	Úmkdir_objectÜs
zS3Backend.mkdir_objectcCs^dj|ƒd}|jdƒr$|dd…}|j|ƒy|jj|j|dWntk
rXYnXdS)zÎ Remove an object that represents a directory in the object store.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.
        r8rN)r,r.)r3r=Ú_S3Backend__delete_object_treer%r5r&r—)r(rRrrIrrr	Úrmdir_objectçs


zS3Backend.rmdir_objectc
CsryR|jdƒd}|jdrv|j|dd}|r`t|dddjdƒd}t|d
ƒ}d|d	}ndd}|d|}n|}x*|D]"}|jdƒ|d
<|jddƒ|d<q€Wtj|ƒ}	|j	j
|j|||	dd|jdrR|rRg}
x|D]}|
jd|iƒqäWy|j	j
|jd|
idWn<tk
rPx$|
D]}|j	j|j|ddq,WYnXWntk
rl‚YnXdS)a Upload a new object manifest to the object store.

        Args:
            object_name (str): Name of the object. A ".manifest" will be added.
            put_headers (dic): Dictionary of meta data to be
                               added to the object.
            manifest_data (dic): The manifest data which becomes
                                 the body of file.
        r8z	.manifestr-T)rN)rOrÚ.réz%08xr2ÚnamerÚhashz
text/plain)r,r.r’r/r|r.r9)r,r:)r,r.Nrl)rPrrBrQr‡rÚpoproÚdumpsr%r4r&r>r?r—r5r)
r(rSZput_headersZ
manifest_datarTrUÚsuffixrVZsegment_datartrwrxrArrr	Úupload_object_manifestûsJ








z S3Backend.upload_object_manifestc
Csºyž|jdƒd}|jdrp|j|dd}|rZt|dddjdƒd}t|d
ƒ}d|}ndd}|d|}n|}tjj|j	|ƒ}|j
j|j	|||dd
Wntk
r´‚YnXdS)a
 Upload a new object manifest to the object store.

        Args:
            object_name (str): Name of the object. A ".manifest" will be added.
            attributes (dic): The attributes data which becomes
                              the body of file.
        r8z	.manifestr-T)rN)rOrrŸrr z%08xZREPLACE)r,r.Z
CopySourcer’ZMetadataDirectiveNrl)
rPrrBrQr‡rr1r2r3r&r%Zcopy_objectr)r(rSZ
attributesrTrUr¥rVZcopy_srcrrr	Úupdate_object_attributes.s*



z"S3Backend.update_object_attributescCsFy*|jdƒ}|jj|j||j|dœdWntk
r@‚YnXdS)a€ Upload a new object manifest to the object store.

        Args:
            object_name (str): Name of the object. A ".manifest" will be added.
            put_headers (dic): Dictionary of meta data to be added
                               to the object.
            manifest_data (dic): The manifest data which becomes the
                                  body of file.
        r8)ÚModeÚRetainUntilDate)r,r.Ú	RetentionN)rPr%Úput_object_retentionr&r'r)r(rSÚretainuntilrrr	Úput_object_segment_retentionOs

z&S3Backend.put_object_segment_retentioncCs®y’|jdƒd}|jdrp|j|dd}|rZt|dddjdƒd}t|d
ƒ}d|}ndd}|d|}n|}|jj|j||j	|dœd
Wnt
k
r¨‚YnXdS)aK Upload a new object manifest to the object store.

        Args:
            object_name (str): Name of the object. A ".manifest"
            will be added. put_headers (dic): Dictionary of meta data
            to be added to the object. manifest_data (dic): The manifest
            data which becomes the body of file.
        r8z	.manifestr-T)rN)rOrrŸrr z%08x)r¨r©)r,r.rªNrl)rPrrBrQr‡rr%r«r&r'r)r(rSr¬rTrUr¥rVrrr	Úput_manifest_retentiones(	


z S3Backend.put_manifest_retentionc)Cs*y|jj|j|dWntk
r$}zî|jdddkr|jdƒ}d}xÄ|D]¼}|dkrbP||d}y|jj|j|dWqTtk
r}zl|jdddkrüy|jj|j|ddd	Wn6tk
rú}z|jddd
krê‚WYdd}~XnXwTWYdd}~XqTXqTWWYdd}~XnXdS)a< Utility method used to create a object directory structure.

        The entire path is split and each directory level is created
        as an object if it does not exist.

        Args:
            folder_name (str): The entire folder name.
            options (dic): Dictionary of configuration options.
        )r,r.rWrXi”r8rzTrilioVault directory objectzapplication/x-directory)r,r.r/r|i™N)r%r[r&rr\r‡r4)r(Zfolder_namerraÚ
path_partsÚnew_pathÚpartrrr	Z__create_folder†s:



	
zS3Backend.__create_foldercCsÊ|dd…}y¢|jdkr<|jtjj|dd|dƒ|ƒ|jdk	r¬t|ddƒR}|jj||j	|dd|ddd	id
|jj
|j	|dd|dd}|SQRXWntk
rÄ‚YnXdS)zµ Upload an object to the S3 object store.

        Args:
            args (list): List of object name parts.
            options (dic): Dictionary of configuration options.
        rNFrr8rSÚrbr|zapplication/octet-stream)r,r.Z	ExtraArgs)r,r.)r}r~r1r2rrSÚopenr%Zupload_fileobjr&r[r)r(rRrÚfilesÚdatarrrr	Ú
upload_object·s(



zS3Backend.upload_object)r)NF)r)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r)r+r7rHrrMr5rrrvryr{rnr4rBrŒr–r›rœržr¦r§r­r®r~r¶rrrr	r1s4,2
#
<"
d
SI3!!1r)rºrr]ror1Zloggingr"r!Zbotocore.exceptionsrZs3fuse.utilsrZBASENAMEr<rˆr Z	getLoggerr·ZLOGr
Úobjectrrrrr	Ú<module>s