%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyc

�
���^c@@s�dZddlmZmZmZddlZddlmZddlm	Z	ddl
ZddlZddl
ZddlmZeje�ZyKddlZddlZddlmZejd�jej�eZWnek
r�eZnXd	�Zd
�Zddddd�Z dddddddddddd�Z!ddeddddd
�Z"ddddddd�Z#ddddd�Z$ddddddd�Z%ddddd�Z&dddddddd�Z'dddedddddd�	Z(dddddddddddd�Z)ddddd�Z*ddddd�Z+dddddddd�Z,dddddddd�Z-ddddd�Z.ddddd�Z/ddddd�Z0ddddd�Z1ddddd�Z2ddddddd�Z3ddddddddd�Z4ddddd �Z5ddddd!�Z6ddddd"�Z7ddddd#�Z8ddddd$�Z9ddddd%�Z:dS(&u6
Connection module for Amazon S3 Buckets

.. versionadded:: 2016.3.0

:depends:
    - boto
    - boto3

The dependencies listed above can be installed via package or pip.

:configuration: This module accepts explicit Lambda credentials but can also
    utilize IAM roles assigned to the instance through Instance Profiles.
    Dynamic credentials are then automatically obtained from AWS API and no
    further configuration is necessary. More Information available at:

    .. code-block:: text

        http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/iam-roles-for-amazon-ec2.html

    If IAM roles are not used you need to specify them either in a pillar or
    in the minion's config file:

    .. code-block:: yaml

        s3.keyid: GKTADJGHEIQSXMKKRBJ08H
        s3.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        s3.region: us-east-1

    If a region is not specified, the default is us-east-1.

    It's also possible to specify key, keyid and region via a profile, either
    as a passed in dict, or as a string to pull from pillars or minion config:

    .. code-block:: yaml

        myprofile:
            keyid: GKTADJGHEIQSXMKKRBJ08H
            key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs
            region: us-east-1

i(tabsolute_importtprint_functiontunicode_literalsN(tsix(trange(tSaltInvocationError(tClientErroruboto3cC@stjjjdd�S(ug
    Only load if boto libraries exist and if boto libraries are greater than
    a given version.
    t	boto3_veru1.2.1(tsalttutilstversionstcheck_boto_reqs(((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt__virtual__TscC@s1tjjjt�tr-tdtd�ndS(Nuboto3.assign_funcsus3(RR	tcompattpack_dundert__name__tHAS_BOTOt	__utils__(topts((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt__init__asc		C@s�yBtd|d|d|d|�}|jd|�}itd6SWnZtk
r�}|jjdi�jd�d	kr�itd6Std
|�}i|d6SXdS(
u
    Given a bucket name, check to see if the given bucket exists.

    Returns True if the given bucket exists and returns False if the given
    bucket does not exist.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.exists mybucket

    tregiontkeytkeyidtprofiletBucketuexistsuErroruCodeu404uboto3.get_erroruerrorN(t	_get_connthead_buckettTrueRtresponsetgettFalseR(	RRRRRtconntbucketsteterr((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytexistsgs!$c	C@s3ytd|d|	d|
d|�}i}
x;dD]3}t�|dk	r1tt�|�|
|<q1q1W|r�i|d6|
d<n|jd
||
�}|jd�jd
|�|r�tjd|d�it	d6|d6|dd6Stj
d�itd6SWn,tk
r.}itd6t
d|�d6SXdS(uU
    Given a valid config, create an S3 Bucket.

    Returns {created: true} if the bucket was created and returns
    {created: False} if the bucket was not created.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.create my_bucket \
                         GrantFullControl='emailaddress=example@example.com' \
                         GrantRead='uri="http://acs.amazonaws.com/groups/global/AllUsers"' \
                         GrantReadACP='emailaddress="exampl@example.com",id="2345678909876432"' \
                         LocationConstraint=us-west-1

    RRRRuACLuGrantFullControlu	GrantReaduGrantReadACPu
GrantWriteu
GrantWriteACPuLocationConstraintuCreateBucketConfigurationRu
bucket_existsu.The newly created bucket name is located at %suLocationucreatedunameuBucket was not createduboto3.get_erroruerrorN(uACLuGrantFullControlu	GrantReaduGrantReadACPu
GrantWriteu
GrantWriteACP(RtlocalstNonetstrt
create_buckett
get_waitertwaittlogtinfoRtwarningRRR(RtACLtLocationConstrainttGrantFullControlt	GrantReadtGrantReadACPt
GrantWritet
GrantWriteACPRRRRRtkwargstargtlocationR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytcreate�s(!
	
c
C@s�ywtd|d|d|d|�}|r[t|d|d|d|d|d|d|�n|jd|�itd6SWn,tk
r�}	itd6td	|	�d
6SXdS(u!
    Given a bucket name, delete it, optionally emptying it first.

    Returns {deleted: true} if the bucket was deleted and returns
    {deleted: false} if the bucket was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete mybucket

    RRRRtMFAtRequestPayerRudeleteduboto3.get_erroruerrorN(Rtemptyt
delete_bucketRRRR(
RR8R9tForceRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete�s!c
C@s�t|tj�r*tjjj|�}nt|t�sHtd��nd|krctd��ng}|d}	xt	dt
|	�d�D]}
|	|
|
d!}i|d6td6}y�i|d6}
|r�|
ji|d6�nd|r|
ji|d6�nd|
ji|d	6�td
|d|d|d
|�}|j|
�}||jdg�7}Wq�tk
r�}itd6td|�d6SXq�Wt
|�r�itd6|d6Sitd6SdS(u&
    Delete objects in a given S3 bucket.

    Returns {deleted: true} if all objects were deleted
    and {deleted: false, failed: [key, ...]} otherwise

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_objects mybucket '{Objects: [Key: myobject]}'

    uMalformed Delete request.uObjectsii�uQuietuBucketuMFAuRequestPayeruDeleteRRRRuErrorsudeleteduboto3.get_erroruerrorufailedN(t
isinstanceRtstring_typesRR	tjsontloadstdictRRtlenRtupdateR%Rtdelete_objectsRRRR(RtDeleteR8R9RRRRtfailedtobjstitchunktsubsettargsRtretR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyRE�s0

  !!c	C@sPy�td|d|d|d|�}i}i|jd6|jd6|jd6|jd6|jd	6|jd
6|jd6|jd6|j	d
6|j
d6|jd6}x�tj
|�D]�\}}y|d|�}	Wn@tk
r}
|
jjdi�jd�d#kr	q�n�nXd|	kr&|	d=n|	||<q�Wi}yL|jd|�}	x3|	jd�D]"}|jd�||jd�<q_WWn=tk
r�}
|
jjdi�jd�dks��q�nX|r�||d<ni|d6SWndtk
rK}
td|
�}
|
jjdi�jd�d kr6id"d6Sitd|
�d!6SXd"S($u�
    Given a bucket name describe its properties.

    Returns a dictionary of interesting properties.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.describe mybucket

    RRRRuACLuCORSuLifecycleConfigurationuLocationuLogginguNotificationConfigurationuPolicyuReplicationuRequestPaymentu
VersioninguWebsiteRuErroruCodeuNoSuchLifecycleConfigurationuNoSuchCORSConfigurationuNoSuchBucketPolicyuNoSuchWebsiteConfigurationu%ReplicationConfigurationNotFoundErroruNoSuchTagSetuResponseMetadatauTagSetuValueuKeyuTaggingubucketuboto3.get_erroruNoSuchBucketuerrorN(uNoSuchLifecycleConfigurationuNoSuchCORSConfigurationuNoSuchBucketPolicyuNoSuchWebsiteConfigurationu%ReplicationConfigurationNotFoundErroruNoSuchTagSet(Rtget_bucket_acltget_bucket_corst"get_bucket_lifecycle_configurationtget_bucket_locationtget_bucket_loggingt%get_bucket_notification_configurationtget_bucket_policytget_bucket_replicationtget_bucket_request_paymenttget_bucket_versioningtget_bucket_websiteRt	iteritemsRRRtget_bucket_taggingRR%(RRRRRRtresultt	conn_dicttquerytdataR!ttagsttagdefR"((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdescribe�s\!










	
$$

$cC@s3t|d|d|d|d|�}i}g|jdg�D]"}	i|	dd6|	dd6^q=|d<|dcg|jd	g�D]"}	i|	dd6|	dd6^q�7<t|d�r(t||d
|d|d|d|d|d|�}
|
jdg�}t|�r(itd
6|
|d6Snitd
6S(u
    Delete all objects in a given S3 bucket.

    Returns {deleted: true} if all objects were deleted
    and {deleted: false, failed: [key, ...]} otherwise

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.empty mybucket

    RRRRuVersionsuKeyu	VersionIduObjectsu
DeleteMarkersR8R9ufailedudeleted(tlist_object_versionsRRCRERR(RR8R9RRRRtstuffRFtvRMRG((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyR:>s	?Ec	C@s�yptd|d|d|d|�}|j�}t|jd��sUtjd�nd|krk|d=n|SWn%tk
r�}itd|�d	6SXd
S(u�
    List all buckets owned by the authenticated sender of the request.

    Returns list of buckets

    CLI Example:

    .. code-block:: yaml

        Owner: {...}
        Buckets:
          - {...}
          - {...}

    RRRRuBucketsuNo buckets founduResponseMetadatauboto3.get_erroruerrorN(Rtlist_bucketstboolRR*R,RR(RRRRRR R!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytlist\s!
c	C@spyDg}g}	i|d6}
|r8|
ji|d6�nd|rX|
ji|d6�nd|rx|
ji|d6�ndtd|d|d|d|�}t}x�|r0|j|
�}
|
jd	t�}|d
dtfkr|
d|
d
<|
d|
d<n||
jdg�7}|	|
jdg�7}	q�Wi|d6|	d6SWn%tk
rk}itd|�d6SXdS(u�
    List objects in a given S3 bucket.

    Returns a list of objects.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.list_object_versions mybucket

    uBucketu	DelimiteruEncodingTypeuPrefixRRRRuIsTruncateduTrueutrueu
NextKeyMarkeru	KeyMarkeruNextVersionIdMarkeruVersionIdMarkeruVersionsu
DeleteMarkersuboto3.get_erroruerrorN(	RDR%RRRbRRRR(Rt	DelimitertEncodingTypetPrefixRRRRtVersionst
DeleteMarkersRLRtIsTruncatedRMR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyRbxs(
   !	c
	C@sfy:g}
i|d6|d6}|r9|ji|d6�nd|rY|ji|d6�nd|ry|ji|d6�nd|r�|ji|d6�ndtd|d|d	|d
|	�}t}
xg|
r-|j|�}|jdt�}
|
dd
tfkr|d|d<n|
|jdg�7}
q�Wi|
d6SWn%tk
ra}itd|�d6SXdS(u�
    List objects in a given S3 bucket.

    Returns a list of objects.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.list_objects mybucket

    uBucketu
FetchOwneru	DelimiteruEncodingTypeuPrefixu
StartAfterRRRRuIsTruncateduTrueutrueuNextContinuationTokenuContinuationTokenuContentsuboto3.get_erroruerrorN(	RDR%RRtlist_objects_v2RRRR(RRhRiRjt
FetchOwnert
StartAfterRRRRtContentsRLRRmRMR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytlist_objects�s$    !	c	C@sy�td|d|	d|
d|�}i}
|dk	rmt|tj�r`tjjj|�}n||
d<nx;dD]3}t	�|dk	rtt
t	�|�|
|<qtqtW|jd||
�itd
6|d6SWn,t
k
r�}itd
6td|�d6SXdS(u)
    Given a valid config, update the ACL for a bucket.

    Returns {updated: true} if the ACL was updated and returns
    {updated: False} if the ACL was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_acl my_bucket 'public' \
                         GrantFullControl='emailaddress=example@example.com' \
                         GrantRead='uri="http://acs.amazonaws.com/groups/global/AllUsers"' \
                         GrantReadACP='emailaddress="exampl@example.com",id="2345678909876432"'

    RRRRuAccessControlPolicyuACLuGrantFullControlu	GrantReaduGrantReadACPu
GrantWriteu
GrantWriteACPRuupdatedunameuboto3.get_erroruerrorN(uACLuGrantFullControlu	GrantReaduGrantReadACPu
GrantWriteu
GrantWriteACP(RR%R>RR?RR	R@RAR$R&tput_bucket_aclRRRR(RR-tAccessControlPolicyR/R0R1R2R3RRRRRR4R5R!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_acl�s"!

c	C@s�y�td|d|d|d|�}|dk	rZt|tj�rZtjjj|�}n|j	d|di|d6�it
d6|d	6SWn,tk
r�}itd6t
d
|�d6SXdS(
u�
    Given a valid config, update the CORS rules for a bucket.

    Returns {updated: true} if CORS was updated and returns
    {updated: False} if CORS was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_cors my_bucket '[{\
              "AllowedHeaders":[],\
              "AllowedMethods":["GET"],\
              "AllowedOrigins":["*"],\
              "ExposeHeaders":[],\
              "MaxAgeSeconds":123,\
        }]'

    RRRRRtCORSConfigurationu	CORSRulesuupdatedunameuboto3.get_erroruerrorN(RR%R>RR?RR	R@RAtput_bucket_corsRRRR(Rt	CORSRulesRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_cors�s!c	C@s�y�td|d|d|d|�}|dk	rZt|tj�rZtjjj|�}n|j	d|di|d6�it
d6|d	6SWn,tk
r�}itd6t
d
|�d6SXdS(
uo
    Given a valid config, update the Lifecycle rules for a bucket.

    Returns {updated: true} if Lifecycle was updated and returns
    {updated: False} if Lifecycle was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_lifecycle_configuration my_bucket '[{\
              "Expiration": {...},\
              "ID": "idstring",\
              "Prefix": "prefixstring",\
              "Status": "enabled",\
              "Transitions": [{...},],\
              "NoncurrentVersionTransitions": [{...},],\
              "NoncurrentVersionExpiration": {...},\
        }]'

    RRRRRtLifecycleConfigurationuRulesuupdatedunameuboto3.get_erroruerrorN(RR%R>RR?RR	R@RAt"put_bucket_lifecycle_configurationRRRR(RtRulesRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_lifecycle_configurations!c	C@s,y�td|d|d|d|�}i}	i|d6|d6|d6}
x6tj|
�D]%\}}|dk	rU||	|<qUqUW|	r�i|	d6}ni}|dk	r�t|tj�r�tjjj	|�}n|j
d	|d
|�itd6|d6SWn,tk
r'}
it
d6td
|
�d6SXdS(uI
    Given a valid config, update the logging parameters for a bucket.

    Returns {updated: true} if parameters were updated and returns
    {updated: False} if parameters were not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_logging my_bucket log_bucket '[{...}]' prefix

    RRRRuTargetBucketuTargetGrantsuTargetPrefixuLoggingEnabledRtBucketLoggingStatusuupdatedunameuboto3.get_erroruerrorN(RRRYR%R>R?RR	R@RAtput_bucket_loggingRRRR(RtTargetBuckettTargetPrefixtTargetGrantsRRRRRtlogstatettargetstvalt	logstatusR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_logging2s$!

c
	C@sRytd|d|d|d|�}|dkr9g}n*t|tj�rctjjj|�}n|dkrxg}n*t|tj�r�tjjj|�}n|dkr�g}n*t|tj�r�tjjj|�}n|j	d|di|d6|d6|d	6�it
d
6|d6SWn,tk
rM}	itd
6t
d|	�d
6SXdS(u�
    Given a valid config, update the notification parameters for a bucket.

    Returns {updated: true} if parameters were updated and returns
    {updated: False} if parameters were not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_notification_configuration my_bucket
                [{...}] \
                [{...}] \
                [{...}]

    RRRRRtNotificationConfigurationuTopicConfigurationsuQueueConfigurationsuLambdaFunctionConfigurationsuupdatedunameuboto3.get_erroruerrorN(RR%R>RR?RR	R@RAt%put_bucket_notification_configurationRRRR(
RtTopicConfigurationstQueueConfigurationstLambdaFunctionConfigurationsRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_notification_configurationXs*!			c	C@s�y�td|d|d|d|�}|dkr9d}n*t|tj�sctjjj|�}n|j	d|d|�it
d6|d	6SWn,tk
r�}itd6t
d
|�d6SXdS(
u
    Given a valid config, update the policy for a bucket.

    Returns {updated: true} if policy was updated and returns
    {updated: False} if policy was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_policy my_bucket {...}

    RRRRu{}RtPolicyuupdatedunameuboto3.get_erroruerrorN(RR%R>RR?RR	R@tdumpstput_bucket_policyRRRR(RR�RRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt
put_policy�s!	c	C@s||jd�r|Stdd|d|d|d|�}|rWd|krW|d}n|dkrld}nd	j||�S(
Nuarn:aws:iam:uboto_iam.get_account_idRRRRuregionu	us-east-1uarn:aws:iam::{0}:role/{1}(t
startswitht__salt__R%tformat(tnameRRRRt
account_id((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt
_get_role_arn�s

	c	C@s�y�td|d|d|d|�}td|d|d|d|d|�}|dkr`g}n*t|tj�r�tjjj	|�}n|j
d|di|d6|d	6�itd
6|d6SWn,tk
r�}it
d
6td|�d
6SXdS(ub
    Given a valid config, update the replication configuration for a bucket.

    Returns {updated: true} if replication configuration was updated and returns
    {updated: False} if replication configuration was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_replication my_bucket my_role [...]

    RRRRR�RtReplicationConfigurationuRoleuRulesuupdatedunameuboto3.get_erroruerrorN(RR�R%R>RR?RR	R@RAtput_bucket_replicationRRRR(	RtRoleR|RRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_replication�s!	c	C@s�yTtd|d|d|d|�}|jd|di|d6�itd6|d	6SWn,tk
r�}itd6td
|�d6SXdS(
un
    Given a valid config, update the request payment configuration for a bucket.

    Returns {updated: true} if request payment configuration was updated and returns
    {updated: False} if request payment configuration was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_request_payment my_bucket Requester

    RRRRRtRequestPaymentConfigurationuPayeruupdatedunameuboto3.get_erroruerrorN(Rtput_bucket_request_paymentRRRR(RtPayerRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_request_payment�s!c	K@s�y�td|d|d|d|�}g}xhtj|�D]W\}}	tj|�jd�rdq:n|jitj|�d6tj|	�d6�q:W|jd|d	i|d
6�itd6|d6SWn,tk
r�}
it	d6t
d
|
�d6SXdS(u!
    Given a valid config, update the tags for a bucket.

    Returns {updated: true} if tags were updated and returns
    {updated: False} if tags were not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_tagging my_bucket my_role [...]

    RRRRu__uKeyuValueRtTagginguTagSetuupdatedunameuboto3.get_erroruerrorN(RRRYt	text_typeR�tappendtput_bucket_taggingRRRR(RRRRRR4RttagslisttkRdR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_tagging�s!1c	C@s�y�td|d|d|d|�}i|d6}	|dk	rJ||	d<ni}
|dk	ri||
d<n|jd|d	|	|
�itd
6|d6SWn,tk
r�}itd
6td|�d
6SXdS(uX
    Given a valid config, update the versioning configuration for a bucket.

    Returns {updated: true} if versioning configuration was updated and returns
    {updated: False} if versioning configuration was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_versioning my_bucket Enabled

    RRRRuStatusu	MFADeleteuMFARtVersioningConfigurationuupdatedunameuboto3.get_erroruerrorN(RR%tput_bucket_versioningRRRR(RtStatust	MFADeleteR8RRRRRR�R4R!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_versioning
s!


c	
	C@s�y�td|d|d|d|�}	i}
xbdD]Z}t�|}|dk	r1t|tj�r~tjjj	|�|
|<q�||
|<q1q1W|	j
d	|d
|
�itd6|d6SWn,tk
r�}it
d6td
|�d6SXdS(ul
    Given a valid config, update the website configuration for a bucket.

    Returns {updated: true} if website configuration was updated and returns
    {updated: False} if website configuration was not updated.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.put_website my_bucket IndexDocument='{"Suffix":"index.html"}'

    RRRRu
ErrorDocumentu
IndexDocumentuRedirectAllRequestsTouRoutingRulesRtWebsiteConfigurationuupdatedunameuboto3.get_erroruerrorN(u
ErrorDocumentu
IndexDocumentuRedirectAllRequestsTouRoutingRules(RR$R%R>RR?RR	R@RAtput_bucket_websiteRRRR(
Rt
ErrorDocumentt
IndexDocumenttRedirectAllRequestsTotRoutingRulesRRRRRR�R�R!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytput_website*s!

c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(u
    Delete the CORS configuration for the given bucket

    Returns {deleted: true} if CORS was deleted and returns
    {deleted: False} if CORS was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_cors my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_corsRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete_corsMs!c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(u2
    Delete the lifecycle configuration for the given bucket

    Returns {deleted: true} if Lifecycle was deleted and returns
    {deleted: False} if Lifecycle was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_lifecycle_configuration my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_lifecycleRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete_lifecycle_configurationes!c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(u
    Delete the policy from the given bucket

    Returns {deleted: true} if policy was deleted and returns
    {deleted: False} if policy was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_policy my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_policyRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt
delete_policy}s!c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(uB
    Delete the replication config from the given bucket

    Returns {deleted: true} if replication configuration was deleted and returns
    {deleted: False} if replication configuration was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_replication my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_replicationRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete_replication�s!c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(u
    Delete the tags from the given bucket

    Returns {deleted: true} if tags were deleted and returns
    {deleted: False} if tags were not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_tagging my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_taggingRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete_tagging�s!c	C@szyGtd|d|d|d|�}|jd|�itd6|d6SWn,tk
ru}itd6td|�d	6SXd
S(u9
    Remove the website configuration from the given bucket

    Returns {deleted: true} if website configuration was deleted and returns
    {deleted: False} if website configuration was not deleted.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_s3_bucket.delete_website my_bucket

    RRRRRudeletedunameuboto3.get_erroruerrorN(Rtdelete_bucket_websiteRRRR(RRRRRRR!((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pytdelete_website�s!(;t__doc__t
__future__RRRtloggingtsalt.extRtsalt.ext.six.movesRtsalt.utils.compatRtsalt.utils.jsontsalt.utils.versionstsalt.exceptionsRt	getLoggerRR*tbototboto3tbotocore.exceptionsRtsetLeveltCRITICALRRtImportErrorRRRR%R#R7R=RERaR:RgRbRrRuRyR}R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s?/usr/lib/python2.7/site-packages/salt/modules/boto_s3_bucket.pyt<module>0s�


	
	+	-A	$	#'!"	%,!"

Zerion Mini Shell 1.0