%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyo

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z
eje�Z
dZddlmZy�ddlZddlZddlZddljjZddljjZejd�jej�ddlZddlmZejd�jej�eZWne k
r<e!ZnXddl"Z#ddl$Z#ddl%j&j'Z'ddl(Z#d	�Z)d
�Z*ddddd�Z,ddddd�Z-ddddddddddddddddddd
�Z.ddddddddddddddddddd�Z/d�Z0d�Z1e!ddddd�Z2d�Z3ddddd�Z4ddddd�Z5ddddd�Z6ddddd�Z7ddddddddde!dde!ddede!ddddd�Z8ddddd�Z9ddddd�Z:ddddd�Z;ddddd�Z<ddddddddd �Z=d!�Z>e!ddddd"�Z?e!ddddd#�Z@dS($u�
Connection module for Amazon Autoscale Groups

.. versionadded:: 2014.7.0

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

        asg.keyid: GKTADJGHEIQSXMKKRBJ08H
        asg.key: askdjghsdfjkghWupUjasdflkdfklgjsdfjajkghs

    A region may also be specified in the configuration:

    .. code-block:: yaml

        asg.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

:depends: boto
:depends: boto3
i(tabsolute_importtprint_functiontunicode_literalsNu%Y-%m-%dT%H:%M:%SZ(tsixuboto(tClientErroruboto3cC@sctjjj�}|tkr_tdtddddt�tt	j
tdtdd��n|S(	u,
    Only load if boto libraries exist.
    uboto.assign_funcsuasgtmoduleu
ec2.autoscaletpacku
_get_ec2_connuboto.get_connection_funcuec2(tsalttutilstversionstcheck_boto_reqstTruet	__utils__t__name__t__salt__tsetattrtsystmodules(t
has_boto_reqs((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyt__virtual__SscC@s7tjjjt�tr3tdtddd�ndS(Nuboto3.assign_funcsuautoscalingtget_conn_funcnameu_get_conn_autoscaling_boto3(RRtcompattpack_dunderR
tHAS_BOTOR(topts((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyt__init___s
	c
	C@s�td|d|d|d|�}d}x�tr�yC|jd|g�}|rRtSdj|�}tj|�tSWq*tjj	k
r�}	|r�|	j
dkr�tjd	�tjd
�|d8}q*ntj
|	�tSXq*WdS(
u�
    Check to see if an autoscale group exists.

    CLI example::

        salt myminion boto_asg.exists myasg region=us-east-1
    tregiontkeytkeyidtprofileitnamesu0The autoscale group does not exist in region {0}u
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN(t	_get_connRtget_all_groupstformattlogtdebugtFalsetbotot	exceptiontBotoServerErrortcodettimetsleepterror(
tnameRRRRtconntretriest_conntmsgte((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytexistsgs$!	




cC@sPtd|d|d|d|�}d}x"trKy�|jd|g�}|r[|d}niStj�}dd	d
ddd
dddddddddg}	x|	D]�}
|
dkrg}xQ|jD]F}tj�}
|j|
d<|j|
d<|j|
d<|j	|
�q�W||d<q�|
dkrIt
||
�jd�||
<q�|
dkr�t
||
�}tg|D]}|j
^qn�||
<q�t
||
�||
<q�W|jd|�}g|d<xa|D]Y}|dj	td|jfd|jfd|jfd|jfd |jfg��q�W|jd|�}i|d!<x�|D]�}d)}|jrn|jj�}ntd|jfd|jfdt|j�fd"|jj�fd#|fd$|jfg�|d!|j<qGW|SWq*tj j!k
rG}|r6|j"d%kr6t#j$d&�t%j&d'�|d(8}q*nt#j'|�iSXq*Wd)S(*u�
    Get the configuration for an autoscale group.

    CLI example::

        salt myminion boto_asg.get_config myasg region=us-east-1
    RRRRiRiunameuavailability_zonesudefault_cooldownudesired_capacityuhealth_check_perioduhealth_check_typeulaunch_config_nameuload_balancersumax_sizeumin_sizeuplacement_groupuvpc_zone_identifierutagsutermination_policiesususpended_processesukeyuvalueupropagate_at_launchu,tas_groupuscaling_policiesuadjustment_typeuscaling_adjustmentumin_adjustment_stepucooldownuscheduled_actionsu
start_timeuend_timeu
recurrenceu
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN((RRR todicttOrderedDictttagsRtvaluetpropagate_at_launchtappendtgetattrtsplittsortedtprocess_nametget_all_policiestdictR,tadjustment_typetscaling_adjustmenttmin_adjustment_steptcooldowntget_all_scheduled_actionstNonetend_timet	isoformattmin_sizetmax_sizetinttdesired_capacityt
start_timet
recurrenceR%R&R'R(R"R#R)R*R+(R,RRRRR-R.tasgtrettattrstattrt_tagsttagt_tagtsuspended_processestxtpoliciestpolicytactionstactionRFR1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyt
get_config�s~!	
					




)




		$



c!C@sztd|d|d|d|�}t|tj�rKtjjj|�}nt|tj�rutjjj|�}nt|tj�r�tjjj|�}nt|tj�r�tjjj|�}ng}|r�x�|D]�}y|jd�}Wnt	k
rt
jd�tSXy|jd�}Wnt	k
rKt
jd�tSX|jd	t�}t
jd|d
|d|d|�}|j|�q�Wnt|
tj�r�tjjj|
�}
nt|tj�r�tjjj|�}nt|tj�rtjjj|�}nd
}xYtruy�t
jd|d|d|d|d|d|d|d|d|d|	d|
d|d|d|
d|�}|j|�t|||�t|||�|r�|r�|j|||�nt
jd|�tSWqtjjk
rq}|rG|jdkrGt
jd�tjd �|d!8}qnt
j|�d"|f} t
j| �tSXqWd#S($u�
    Create an autoscale group.

    CLI example::

        salt myminion boto_asg.create myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
    RRRRukeyuTag missing key.uvalueuTag missing value.upropagate_at_launchR7tresource_idR8iR,t
launch_configtavailability_zonesRHRIRKtload_balancerstdefault_cooldownthealth_check_typethealth_check_periodtplacement_groupR6tvpc_zone_identifierttermination_policiesRUuCreated ASG %su
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiuFailed to create ASG %sN(Rt
isinstanceRtstring_typesRRtjsontloadstgettKeyErrorR"R+R$t	autoscaletTagR9RtAutoScalingGrouptcreate_auto_scaling_groupt_create_scaling_policiest_create_scheduled_actionstput_notification_configurationtinfoR%R&R'R(R#R)R*(!R,tlaunch_config_nameR^RHRIRKR_R`RaRbRcRdR6ReRUtscaling_policiestscheduled_actionsRtnotification_arntnotification_typesRRRR-RRRSR7R8RTR.t_asgR1R0((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytcreate�s�!




				





c(C@s�td|d|d|d|�}td|d|d|d|�}|sRtdfSt|tj�r|tjjj	|�}nt|tj�r�tjjj	|�}nt|tj�r�tjjj	|�}nt|tj�r�tjjj	|�}nt|
tj�r$tjjj	|
�}
nt|tj�rNtjjj	|�}nt|tj�rxtjjj	|�}n|j
didd6|gd	6g�jd
g�}g|D]@}i|dd6|d
d6|dd6|jdt�d6^q�}g}g}|rtd|�}x�|D]�}y|jd�}Wn.t
k
ritjd�tdj|�fSXy|jd�}Wn.t
k
r�tjd�tdj|�fSX|jdt�}i|d6|d6|d6|d6} | |kr�|j| �n|j| �q Wng|D]}||kr|^q}!d}"x�tr�y�tjd|d|d|d|d|d|d|d |d!|d"|d#|	d$|
d%|d&|d'|
�}#|r�|r�|j|#||�n|#j�|rtjd(|�|jg|D]}tj|�^q��n|!r_tjd)|!�|jg|!D]}tj|�^q@�n|#j�|d4k	r�t|�d*kr�|#j|�ntjd+|�x0|j d,|�D]}$|j!|$j"d-|�q�Wt#|||�x0|j$d,|�D]}%|j%|%j"d-|�q�Wt&|||�td.fSWq@t'j(j)k
r�}&|"r�|&j*d/kr�tjd0�t+j,d1�|"d28}"q@ntj|&�d3j|�}'tj|'�ttj-|&�fSXq@Wd4S(5u�
    Update an autoscale group.

    CLI example::

        salt myminion boto_asg.update myasg mylc '["us-east-1a", "us-east-1e"]' 1 10 load_balancers='["myelb", "myelb2"]' tags='[{"key": "Name", value="myasg", "propagate_at_launch": True}]'
    RRRRufailed to connect to AWStFiltersuauto-scaling-groupuNameuValuesuTagsuKeyukeyuValueuvalueu
ResourceIduresource_iduPropagateAtLaunchupropagate_at_launchu
boto3.ordereduTag missing key.uTag {0} missing keyuTag missing value.uTag {0} missing valueit
connectionR,R]R^RHRIRKR_R`RaRbRcR6RdReu!Adding/updating tags from ASG: %suDeleting tags from ASG: %siuUpdated ASG %sR3tautoscale_groupuu
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiuFailed to update ASG {0}N(.Rt_get_conn_autoscaling_boto3R$RfRRgRRRhRit
describe_tagsRjRRkR"R+R!R9RRlRnRrtupdateR#tcreate_or_update_tagsRmtdelete_tagstresume_processesREtlentsuspend_processesRsR>t
delete_policyR,RpRDtdelete_scheduled_actionRqR%R&R'R(R)R*t	text_type((R,RtR^RHRIRKR_R`RaRbRcRdR6ReRURuRvRwRxRRRRR-tconn3tcurrent_tagstttadd_tagstdesired_tagsRSR7R8RTR�R.RyRXtscheduled_actionR1R0((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�/s�!	
J






%			
,,





cC@sz|rvxm|D]b}tjjd|dd|d|dd|dd|jd	d�d
|d�}|j|�q
WndS(
u*helper function to create scaling policiesR,unametas_nameR@uadjustment_typeRAuscaling_adjustmentRBumin_adjustment_stepRCucooldownN(RlRXt
ScalingPolicyRjREtcreate_scaling_policy(R-R�RuRX((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyRp�s




cC@s|rxtj|�D]�\}}d|krdt|dtj�rdtjj|dt�|d<nd|kr�t|dtj�r�tjj|dt�|d<n|j||d|jd�d|jd�d|jd�d	|jd�d
|jd�d|jd��qWnd
S(u5
    Helper function to create scheduled actions
    u
start_timeuend_timeRKudesired_capacityRHumin_sizeRIumax_sizeRLRFRMu
recurrenceN(	Rt	iteritemsRfRgtdatetimetstrptimetDATE_FORMATtcreate_scheduled_group_actionRj(R-R�RvR,RZ((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyRq�s"	"	c
	C@s�td|d|d|d|�}d}x�tr�y4|j||�dj|�}tj|�tSWq*tjjk
r�}	|r�|	j	dkr�tj
d�tjd	�|d
8}q*ntj
|	�dj|�}tj
|�tSXq*WdS(
uu
    Delete an autoscale group.

    CLI example::

        salt myminion boto_asg.delete myasg region=us-east-1
    RRRRiuDeleted autoscale group {0}.u
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiu$Failed to delete autoscale group {0}N(RRtdelete_auto_scaling_groupR!R"RsR%R&R'R(R#R)R*R+R$(
R,tforceRRRRR-R.R0R1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytdelete�s$!	





cC@sIt|tj�r*tjjj|�}ntjj	j
�}d|kr�xItj|d�D]1\}}tjjj
|d�}|j|�q\Wnd|kr�xItj|d�D]1\}}tjjj
|d�}|j|�q�Wnd|kr?|d}tjjj
tjjj|dt�d�}|j|�n|j�S(u�
    Get a mime multipart encoded string from a cloud-init dict. Currently
    supports boothooks, scripts and cloud-config.

    CLI Example:

    .. code-block:: bash

        salt myminion boto.get_cloud_init_mime <cloud init>
    u	boothooksucloud-boothookuscriptsu
x-shellscriptucloud-configtdefault_flow_style(RfRRgRRRhRitemailtmimet	multipartt
MIMEMultipartR�ttexttMIMETexttattachtyamlt	safe_dumpR$t	as_string(t
cloud_initt_cloud_inittscript_nametscriptt_scripttcloud_configt
_cloud_config((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytget_cloud_init_mime�s$  
	c
	C@s�td|d|d|d|�}d}x�tr�yC|jd|g�}|rRtSdj|�}tj|�tSWq*tjj	k
r�}	|r�|	j
dkr�tjd	�tjd
�|d8}q*ntj
|	�tSXq*WdS(
u�
    Check for a launch configuration's existence.

    CLI example::

        salt myminion boto_asg.launch_configuration_exists mylc
    RRRRiRu5The launch configuration does not exist in region {0}u
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN(RRtget_all_launch_configurationsR!R"R#R$R%R&R'R(R)R*R+(
R,RRRRR-R.tlcR0R1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytlaunch_configuration_existss$	!	




c	C@s�td|d|d|d|�}d}x�tr�y|j�SWq*tjjk
r�}|r�|jdkr�tjd�t	j
d�|d	8}q*ntj|�gSXq*Wd
S(u�
    Fetch and return all Launch Configuration with details.

    CLI example::

        salt myminion boto_asg.get_all_launch_configurations
    RRRRiu
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN(RRR�R%R&R'R(R"R#R)R*R+(RRRRR-R.R1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�/s	!	



cC@s/t||||�}g|D]}|j^qS(uw
    List all Launch Configurations.

    CLI example::

        salt myminion boto_asg.list_launch_configurations
    (R�R,(RRRRROtr((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytlist_launch_configurationsGs	c
	C@s�td|d|d|d|�}d}x�tr�yG|jd|g�}|rV|dSdj|�}tj|�d
SWq*tjj	k
r�}	|r�|	j
d	kr�tjd
�tjd�|d8}q*ntj
|	�d
SXq*Wd
S(u�
    Dump details of a given launch configuration.

    CLI example::

        salt myminion boto_asg.describe_launch_configuration mylc
    RRRRiRiu5The launch configuration does not exist in region {0}u
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN(RRR�R!R"R#RER%R&R'R(R)R*R+(
R,RRRRR-R.R�R0R1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytdescribe_launch_configurationTs$	!	




um1.smallc%'C@s�td|d|d|d|�}t|tj�rKtjjj|�}nt|
tj�rutjjj|
�}
ng}|
rtj	�}xt|
D]l}xctj
|�D]R\}}tj�}x-tj
|�D]\}} t||| �q�W|||<q�Wq�W|g}n|rY|s"|rYt
d|d|d|d|d|d|d|�}ntjd|d	|d
|d|d|d
|d|d|	d|d|d|d|
d|d|d|d|d|d|�}!d}"x�tr�y%|j|!�tjd|�tSWq�tjjk
r�}#|"r\|#jdkr\tjd�tjd�|"d8}"q�ntj|#�d j|�}$tj|$�tSXq�Wd!S("u�
    Create a launch configuration.

    CLI example::

        salt myminion boto_asg.create_launch_configuration mylc image_id=ami-0b9c9f62 key_name='mykey' security_groups='["mygroup"]' instance_type='c3.2xlarge'
    RRRRu"boto_secgroup.convert_to_group_idstvpc_idtvpc_nameR,timage_idtkey_nametsecurity_groupst	user_datat
instance_typet	kernel_idt
ramdisk_idtblock_device_mappingstinstance_monitoringt
spot_pricetinstance_profile_namet
ebs_optimizedtassociate_public_ip_addresstvolume_typetdelete_on_terminationtiopstuse_block_device_typesiu
Created LC %su
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiuFailed to create LC {0}N(RRfRRgRRRhRitblockdevicemappingtBlockDeviceMappingR�tEBSBlockDeviceTypeRRRltLaunchConfigurationRtcreate_launch_configurationR"RsR%R&R'R(R#R)R*R+R!R$(%R,R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RRRRR-t_bdmst_block_device_maptblock_device_dicttblock_devicet
attributest
_block_devicet	attributeR7R�R.R1R0((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�rs`!
		





c		C@s�td|d|d|d|�}d}x�tr�y%|j|�tjd|�tSWq*tjjk
r�}|r�|jdkr�tj	d�t
jd	�|d
8}q*ntj|�dj
|�}tj|�tSXq*WdS(
u|
    Delete a launch configuration.

    CLI example::

        salt myminion boto_asg.delete_launch_configuration mylc
    RRRRiu
Deleted LC %su
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiuFailed to delete LC {0}N(RRtdelete_launch_configurationR"RsR%R&R'R(R#R)R*R+R!R$(	R,RRRRR-R.R1R0((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR��s"	!	





c	C@s�td|d|d|d|�}d}x�|dkr�|d8}yQ|jd|�}x$|D]}	|	j|kr\|	jSq\Wtjd	|�dSWq*tjj	k
r�}
|
j
d
kr��ntjd�tj
d�q*Xq*Wtjd
�dS(u!
    Return the arn for a scaling policy in a specific autoscale group or None
    if not found. Mainly used as a helper method for boto_cloudwatch_alarm, for
    linking alarms to scaling policies.

    CLI Example::

        salt '*' boto_asg.get_scaling_policy_arn mygroup mypolicy
    RRRRiiiR3uCould not convert: %su
Throttlingu)Throttled by API, will retry in 5 secondsiu"Maximum number of retries exceededN(RR>R,t
policy_arnR"R+RER%R&R't
error_codeR#R)R*(R3tscaling_policy_nameRRRRR-R.RWRXR1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytget_scaling_policy_arn�s$!



c	C@std|d|d|d|�}d}x�tr�y_d}g}xH|dk	r�|jd|�}|g|D]}	|	^qj7}|j}qBW|SWq*tjjk
r�}
|r�|
jdkr�t	j
d	�tjd
�|d8}q*nt	j
|
�gSXq*WdS(
u
    Return all AutoScale Groups visible in the account
    (as a list of boto.ec2.autoscale.group.AutoScalingGroup).

    .. versionadded:: 2016.11.0

    CLI example:

    .. code-block:: bash

        salt-call boto_asg.get_all_groups region=us-east-1 --output yaml

    RRRRiut
next_tokenu
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiN(RRRER R�R%R&R'R(R"R#R)R*R+(RRRRR-R.R�tasgsROtaR1((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR �s&!	




c
C@s5gtd|d|d|d|�D]}|j^q"S(u�
    Return all AutoScale Groups visible in the account
    (as a list of names).

    .. versionadded:: 2016.11.0

    CLI example:

    .. code-block:: bash

        salt-call boto_asg.list_groups region=us-east-1

    RRRR(R R,(RRRRR�((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pytlist_groupssu	InServiceuHealthyuprivate_ip_addressc		C@std|d|d|d|�}	td|d|d|d|�}
d}x�tr�y|	jd|g�}PWqKtjjk
r�}
|r�|
jdkr�tj	d�t
jd	�|d
8}qKntj|
�t
SXqKWt|�d
krtj	d|g|D]}|j^q��t
S|d}g}xc|jD]X}|dk	rX|j|krXq1n|dk	ry|j|kryq1n|j|j�q1W|
jd
|�}|r�g|D](}g|D]}t||�^q�^q�Sg|D]$}t||�r�t||�^q�SdS(u�
    return attribute of all instances in the named autoscale group.

    CLI example::

        salt-call boto_asg.get_instances my_autoscale_group_name

    RRRRiRu
Throttlingu.Throttled by AWS API, retrying in 5 seconds...iiu#name '%s' returns multiple ASGs: %sitinstance_idsN(Rt
_get_ec2_connRR R%R&R'R(R"R#R)R*R+R$R�R,t	instancesREtlifecycle_statet
health_statusR9tinstance_idtget_only_instancest_convert_attributeR:(R,R�R�R�R�RRRRR-tec2_connR.R�R1RNR�tiR�tinstanceRQ((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyt
get_instances.s<!!	



	)
3cC@sN|dkr8tt||��}d�tj|�D�St||�jd�S(NutagscS@s1i|]'\}}|jd�|jd��qS(uutf-8(tencode(t.0RR7((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pys
<dictcomp>`s	uascii(R?R:RR�R�(R�R�R6((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�]sc	C@s�td|d|d|d|�}y"|jd|d|d|�}WnZtk
r�}	td|	�}
|	jjd	i�jd
�dkr�itd6Si|
d
6SXtd�|dD��S(u�
    Switch desired instances to StandBy mode

    .. versionadded:: 2016.11.0

    CLI example::

        salt-call boto_asg.enter_standby my_autoscale_group_name '["i-xxxxxx"]'

    RRRRtInstanceIdstAutoScalingGroupNametShouldDecrementDesiredCapacityuboto3.get_erroruErroruCodeuResourceNotFoundExceptionuexistsuerrorcs@s|]}|ddkVqdS(u
StatusCodeuFailedN((R�tactivity((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pys	<genexpr>|su
Activities(R~t
enter_standbyRRtresponseRjR$tall(R,R�t!should_decrement_desired_capacityRRRRR-R�R1terr((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�es!	
$c	C@s�td|d|d|d|�}y|jd|d|�}WnZtk
r�}	td|	�}
|	jjdi�jd	�d
kr�itd6Si|
d6SXtd
�|dD��S(u�
    Exit desired instances from StandBy mode

    .. versionadded:: 2016.11.0

    CLI example::

        salt-call boto_asg.exit_standby my_autoscale_group_name '["i-xxxxxx"]'

    RRRRR�R�uboto3.get_erroruErroruCodeuResourceNotFoundExceptionuexistsuerrorcs@s|]}|ddkVqdS(u
StatusCodeuFailedN((R�R�((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pys	<genexpr>�su
Activities(R~texit_standbyRRR�RjR$R�(R,R�R�RRRRR-R�R1R�((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyR�s	
$(At__doc__t
__future__RRRR�tloggingRR)temail.mime.multipartR�t	getLoggerR
R"R�tsalt.extRR%tboto.ec2tboto.ec2.instancetboto.ec2.blockdevicemappingtec2R�tboto.ec2.autoscaleRltsetLeveltCRITICALtboto3tbotocore.exceptionsRRRtImportErrorR$tsalt.utils.compatRtsalt.utils.jsontsalt.utils.odictRR4tsalt.utils.versionsRRRER2R[RzR�RpRqR�R�R�R�R�R�R�R�R�R R�R�R�R�R�(((s9/usr/lib/python2.7/site-packages/salt/modules/boto_asg.pyt<module>,s�


		W			O		z								@	#	-	

Zerion Mini Shell 1.0