%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/utils/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/utils/s3.pyc

�
���^c@@s)dZddlmZmZmZddlZyddlZeZWne	k
r]e
ZnXddlZddl
ZddlZddljjZddlmZddlmZddlmZddlmZeje�Zdddde
ddd	e
ddee
dddd
e
ed�Z!dS(u6
Connection library for Amazon S3

:depends: requests
i(tabsolute_importtprint_functiontunicode_literalsN(tElementTree(tCommandExecutionError(tquote(tsixuGETui@c%C@ststjd�n|s%i}n|s4i}n|sCd}n|sP|rY|}ndj||�}|r�|r�dj||	�}	n|s�tjjj}n|s�tjjj}n|d'k	r�|dBkr�d|d<||d	<n|stjjj	�}nd
}d'}d'}|dkrK|rKtjj
j|dd�}qKn|	d'kr`d
}	nt|	�}	|s|r~d
nddj||	�}tjjj
|||d|ddj|	�di|d6|d6d|d|ddd|d|d|�	\}}ntjd|�tjd�tjd|d �|sEd'}nz�|dkr�|r�tjjj|d!�}|j�}ntj||d|d|d"|
d#td$d%�}nv|d&kr|r|
rtj||d|d|d"|
d#td$d%�}n*tj||d|d|d"|
d$d%�}Wd'|d'k	rG|j�nXd'}d'}|jd(kr|jpod)}tjd*|�y0tjtj|��}|d+}|d,}Wqttjfk
r}tjd-t|�j|�d.j|j�}|}qXntjd/|j�|dkr�|jd0kr{|r]t d1j||	||���nt d2j|||���n|r�tjd3||	�ntjd4|�d'S|d5krGt!j"|j�j#d6�s|	r�t d7j|	|||���nt d8j|||���n|	r3tjd9|	|�ntjd:|�d'S|r�|d&kr�|jd0ksw|jd%kr�t d;j||���ntjd<|�tjjj|d=��1}x'|j$d>|�D]} |j%| �q�WWd'QXd?j|�S|jd0ks|jd%kr3t d@j||���n|
r@|jS|jr�tj|j�}!g}"x$|!D]}#|"j&tj|#��qhW|tkr|"|fSnm|jtj'j(kr�d'SigdA6}"|r�t)|j*�|"dA<n+x(|j*D]}$|"dAj&|$j+��q�W|"S(Cu"
    Perform a query against an S3-like API. This function requires that a
    secret key and the id for that key are passed in. For instance:

        s3.keyid: GKTADJGHEIQSXMKKRBJ08H
        s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    If keyid or key is not specified, an attempt to fetch them from EC2 IAM
    metadata service will be made.

    A service_url may also be specified in the configuration:

        s3.service_url: s3.amazonaws.com

    If a service_url is not specified, the default is s3.amazonaws.com. This
    may appear in various documentation as an "endpoint". A comprehensive list
    for Amazon S3 may be found at::

        http://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region

    The service_url will form the basis for the final endpoint that is used to
    query the service.

    Path style can be enabled:

        s3.path_style: True

    This can be useful if you need to use salt with a proxy for an s3 compatible storage

    You can use either https protocol or http protocol:

        s3.https_enable: True

    SSL verification may also be turned off in the configuration:

        s3.verify_ssl: False

    This is required if using S3 bucket names that contain a period, as
    these will not match Amazon's S3 wildcard certificates. Certificate
    verification is enabled by default.

    A region may be specified:

        s3.location: eu-central-1

    If region is not specified, an attempt to fetch the region from EC2 IAM
    metadata service will be made. Failing that, default is us-east-1
    u6There was an error: requests is required for s3 accessus3.amazonaws.comu{0}.{1}u{0}/{1}uPUTuPOSTuaws:kmsux-amz-server-side-encryptionu+x-amz-server-side-encryption-aws-kms-key-idutformusha256uhttpsuhttpu
://{0}/{1}tdataturiu/{0}t	prov_dictuidukeytrole_arntlocationtproductus3t
requesturltheaderstpayload_hashuS3 Request: %suS3 Headers::u    Authorization: %su
Authorizationurbtverifytstreamttimeouti,uGETNi�u
Unknown erroru    Response content: %suCodeuMessageu'Failed to parse s3 err response. %s: %suhttp-{0}uS3 Response Status Code: %si�u*Failed to upload from {0} to {1}. {2}: {3}u%Failed to create bucket {0}. {1}: {2}uUploaded from %s to %suCreated bucket %suDELETEu2u.Failed to delete {0} from bucket {1}. {2}: {3}u%Failed to delete bucket {0}. {1}: {2}uDeleted %s from bucket %suDeleted bucket %suFailed to get file. {0}: {1}uSaving to local file: %suwbt
chunk_sizeuSaved to local file: {0}uFailed s3 operation. {0}: {1}uheaders(uPUTuPOST(,tHAS_REQUESTStlogterrortformattsalttutilstawst
IROLE_CODEtNonetget_locationt	hashutilstget_hasht_quotetsig4tdebugtfilestfopentreadtrequeststrequesttTruetclosetstatus_codetcontenttxmltto_dicttETt
fromstringtKeyErrort
ParseErrorttypet__name__RRt	text_typet
startswithtiter_contenttwritetappendtcodestoktdictRtstrip(%tkeytkeyidtmethodtparamsRRt
return_urltbuckettservice_urltpatht
return_bintactiont
local_filet
verify_ssltfull_headerst	kms_keyidRRRt
path_stylethttps_enabletendpointRtfhRtresultterr_codeterr_msgterr_textterr_dataterrtouttchunktitemstrettitemtheader((s1/usr/lib/python2.7/site-packages/salt/utils/s3.pytquery s,6			
	

!	"
				



	


("t__doc__t
__future__RRRtloggingR'R)RtImportErrortFalsetsalt.utils.awsRtsalt.utils.filestsalt.utils.hashutilstsalt.utils.xmlutilRtxmlutilR-tsalt._compatRR/tsalt.exceptionsRtsalt.ext.six.moves.urllib.parseRR!tsalt.extRt	getLoggerR4RRR\(((s1/usr/lib/python2.7/site-packages/salt/utils/s3.pyt<module>s,


		

Zerion Mini Shell 1.0