%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_cfn.pyo

�
���^c@@s�dZddlmZmZmZddlZddlmZddlZ	ej
e�ZyKddl
Z
ddlZ
ddlmZej
d�jej�eZWnek
r�eZnXd�Zd�Zddddd	�Zddddd
�Zdddddddddddddddd�Zddddeddddddddddddd�Zddddd
�Zddddd�Zddddddd�Z dS(uX
Connection module for Amazon Cloud Formation

.. versionadded:: 2015.5.0

:configuration: This module accepts explicit AWS 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

        cfn.keyid: GKTADJGHEIQSXMKKRBJ08H
        cfn.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        cfn.region: us-east-1

:depends: boto
i(tabsolute_importtprint_functiontunicode_literalsN(tsix(tBotoServerErrorubotocC@stjjjdt�S(u,
    Only load if boto libraries exist.
    tcheck_boto3(tsalttutilstversionstcheck_boto_reqstFalse(((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyt__virtual__;scC@s*tr&tdtddddt�ndS(Nuboto.assign_funcsucfntmoduleucloudformationtpack(tHAS_BOTOt	__utils__t__name__t__salt__(topts((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyt__init__Bsc	C@svtd|d|d|d|�}y'|j|�}tjd|�tSWn'tk
rq}tjddt�tSXdS(	u�
    Check to see if a stack exists.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.exists mystack region=us-east-1
    tregiontkeytkeyidtprofileuStack %s exists.u#boto_cfn.exists raised an exceptiontexc_infoN(t	_get_conntdescribe_stackstlogtdebugtTrueRR
(tnameRRRRtconntexistste((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyR Gs
!c	C@sgtd|d|d|d|�}y|j|�}|r$|d}tjd|j�d}tg|D]*}	t||	�rf|	t||	�f^qf�}
t|d�}t|d
�}i}
i}x|D]}|j|
|j	<q�W|
|
d<x|D]}|j||j	<q�W||
d
<i|
d6Stjd|�t
SWn'tk
rb}tjd||�t
SXdS(u�
    Describe a stack.

    .. versionadded:: 2015.8.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.describe mystack region=us-east-1
    RRRRiu
Found VPC: %sustack_idudescriptionustack_statusustack_status_reasonutagsuoutputsu
parametersustackuStack %s exists.uCould not describe stack %s.
%sN(ustack_idudescriptionustack_statusustack_status_reasonutags(RRRRtstack_idtdictthasattrtgetattrtvalueRRRtwarningR
(RRRRRRtrtstacktkeystktrettotptoutputst
parameterstitjR!((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pytdescribe]s0!
=



c
C@s�td|d|
d|d|�}y2|j||||||||||	|
|�SWn@tk
r�}dj||�}tj|�tj|�tSXdS(u�
    Create a CFN stack.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.create mystack template_url='https://s3.amazonaws.com/bucket/template.cft'         region=us-east-1
    RRRRuFailed to create stack {0}.
{1}N(Rtcreate_stackRtformatRterrorRR
(Rt
template_bodyttemplate_urlR0tnotification_arnstdisable_rollbackttimeout_in_minutestcapabilitiesttagst
on_failuretstack_policy_bodytstack_policy_urlRRRRRR!tmsg((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pytcreate�s
!

cC@s�td|d|d|d|�}yN|j||||||||||	|
|||
�}tjd|�|SWnFtk
r�}dj|�}tj|�tj|�tj|�SXdS(u�
    Update a CFN stack.

    .. versionadded:: 2015.8.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.update_stack mystack template_url='https://s3.amazonaws.com/bucket/template.cft'         region=us-east-1
    RRRRuUpdated result is : %s.uFailed to update stack {0}.N(	Rtupdate_stackRRRR5R6Rt	text_type(RR7R8R0R9R:R;R<R=tuse_previous_templatetstack_policy_during_update_bodytstack_policy_during_update_urlR?R@RRRRRtupdateR!RA((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyRC�s!

c	C@std|d|d|d|�}y|j|�SWnFtk
rz}dj|�}tj|�tj|�tj|�SXdS(u�
    Delete a CFN stack.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.delete mystack region=us-east-1
    RRRRuFailed to create stack {0}.N(	Rtdelete_stackRR5RR6RRRD(RRRRRRR!RA((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pytdelete�s
!

c		C@s�td|d|d|d|�}y'|j|�}tjd|�|SWnFtk
r�}tj|�dj|�}tj|�tj	|�SXdS(u�
    Check to see if attributes are set on a CFN stack.

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.get_template mystack
    RRRRuRetrieved template for stack %suTemplate {0} does not existN(
Rtget_templateRtinfoRRR5R6RRD(	RRRRRRttemplateR!RA((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyRK�s
!

c		C@s�td|d|d|d|�}y|j||�SWnFtk
r}}tj|�dj|�}tj|�tj|�SXdS(u�
    Validate cloudformation template

    .. versionadded:: 2015.8.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_cfn.validate_template mystack-template
    RRRRu,Error while trying to validate template {0}.N(	Rtvalidate_templateRRRR5R6RRD(	R7R8RRRRRR!RA((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyRN�s!

(!t__doc__t
__future__RRRtloggingtsalt.extRtsalt.utils.versionsRt	getLoggerRRtbototboto.cloudformationtboto.exceptionRtsetLeveltCRITICALRRtImportErrorR
RRtNoneR R3RBRCRJRKRN(((s9/usr/lib/python2.7/site-packages/salt/modules/boto_cfn.pyt<module>s6


		+	

Zerion Mini Shell 1.0