%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlmZddlmZmZmZmZddlZddlZddlZddlZddlZddlZddlZddlZddlZddl Zddl!Zddl"Zddl#Zddl$Zddl%m&Z&yddl'Z(Wn5e)k
r�yddl*Z+Wne)k
r�nXnXddl,m-Z-ddl.m/Z/ej0e1�Z2d	�Z3e4e4e4e4e4e4e4d
�Z5de6fd��YZ7d
e6fd��YZ8de8fd��YZ9d�Z:e4d�Z;e4d�Z<e4d�Z=d�Z>d�Z?d�Z@dS(u`
The top level interface used to translate configuration data back to the
correct cloud modules
i(tabsolute_importtprint_functiont
generatorstunicode_literalsN(tgroupby(tSaltCloudNotFoundtSaltCloudExceptiontSaltCloudSystemExittSaltCloudConfigError(tcompile_template(tsix(tinputc@s�fd�}|S(u(Warning, this is a picklable decorator !c@s�||d<d}y �||�}|jd�Wn�tk
r�}tj�}|jd�|jd�|jdj||��nRtk
r�}tj�}|jd�|jd�|jdj||��nX|S(	u7called with [queue, args, kwargs] as first optional arguqueueuENDuKEYBOARDINTuKeyboard interruptu{0}
{1}
uERRORu	ExceptionN(tNonetputtKeyboardInterruptt	tracebackt
format_exctformatt	Exception(tqueuetargstkwargstrettexttrace(tfunc(s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt_call>s 




((RR((Rs7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytcommunicator<scC@s�|si}n|sd}n|s6tj|�}n|sWtj�}|j�}n|dk	r�|r�dj|�}	tj|	�tdj|	���ng|dk	r�g|D]}
||
g|g^q�}|j	d|d|�}n|j
||||g�}x�tr�|j�}
|
d
kr�|j�}|j�}dj|�}	|	d	j|�7}	tj|	�|j
�|j�tdj|	���q|
dks�|r�||
�r�|j�|j�Pqtjd�qW|S(u)
    Manage a multiprocessing pool

    - If the queue does not output anything, the pool runs indefinitely

    - If the queue returns KEYBOARDINT or ERROR, this will kill the pool
      totally calling terminate & join and ands with a SaltCloudSystemExit
      exception notifying callers from the abnormal termination

    - If the queue returns END or callback is defined and returns True,
      it just join the process and return the data.

    target
        the function you want to execute in multiproccessing
    pool
        pool object can be None if you want a default pool, but you ll
        have then to define pool_size instead
    pool_size
        pool size if you did not provide yourself a pool
    callback
        a boolean taking a string in argument which returns True to
        signal that 'target' is finished and we need to join
        the pool
    queue
        A custom multiproccessing queue in case you want to do
        extra stuff and need it later in your program
    args
        positional arguments to call the function with
        if you don't want to use pool.map

    mapped_args
        a list of one or more arguments combinations to call the function with
        e.g. (foo, [[1], [2]]) will call::

                foo([1])
                foo([2])

    kwargs
        kwargs to give to the function in case of process

    Attention, the function must have the following signature:

            target(queue, *args, **kw)

    You may use the 'communicator' decorator to generate such a function
    (see end of this file)
    iueWe are called to asynchronously execute {0} but we do no have anything to execute, weird, we bail outuException caught
{0}RtiterableuERRORuKEYBOARDINTu Caught {0}, terminating workers
uTRACE: {0}
uENDg�?N(uERRORuKEYBOARDINT(uEND(tmultiprocessingtPooltManagertQueueRRtlogterrorRtmaptapplytTruetgett	terminatetjointclosettimetsleep(ttargettmapped_argsRRtpoolt	pool_sizetcallbackRtmanagertmsgtargRRttestttype_R((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytenter_mainloopSsF7			
%	




tCloudClientcB@s�eZdZddddd�Zd�Zd�Zdd�Zdd�Zdd�Z	dd�Z
d	d
�Zdd�Zd
d�Z
dd�Zdd�Zd�Zd�Zd�Zddddddd�ZRS(u5
    The client class to wrap cloud interactions
    cC@s�|r||_ntjj|�|_|jdg}tjjj|tjjj��|r�x_t	j
|jdi��D]B\}}|d}i|d<|jdjii||6|6�q{Wx�t	j
|jdi��D]�\}}	|	dj
d�d}tt	j|jd|��}dj||�|	d<||	d	<|jdji|	|6�|jd||dji|	|6�q�WxYt	j
|jd
i��D]<\}}
d
|jkr�i|jd
<n|
|jd
|<q�W|jj|�ndS(Nucachediru	providersudriveruprofilesuprovideru:iu{0}:{1}uprofileumaps(toptstsalttconfigtcloud_configtutilstverifyt
verify_envtusertget_userR
t	iteritemstpoptupdatetsplittnexttiterkeysR(tselftpathR8t
config_dirtpillarstv_dirstnametprovidertdrivertprofiletmap_dct((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt__init__�s,"(

&( 
+(c
K@s�tjjj�}|j|jj��t|d<t|d<t|d<t|d<t|d<d|d<d|kr�|j|d�n|j|�|jd	d�}|r�|jd
i�j�}x=g|D]}|^q�D]"}||ks�|j
|�q�q�Wgtj|�D]7}|jdd�r|jdd�j
d�d
^q}|r�|jdi�}x3|j�D]"}	|	|krs|j
|	�qsqsWq�n|S(ui
        Set the opts dict to defaults and allow for opts to be overridden in
        the kwargs
        uparallelukeep_tmpudeployuupdate_bootstrapushow_deploy_argsuuscript_argsukwargsuprofileuprofilesuprovideru:iu	providersN(R9R:tDEFAULT_CLOUD_OPTStcopyRCR8tFalseR%R&RRBR
t
itervaluesRD(
RGRR8ROttmp_profilestat_profilet	providerst
_providersRM((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt_opts_defaults�s4






 7cC@sLt||�}tjjj||�}||jdd�|jdi��S(uG
        Pass the cloud function and low data structure to run
        uargsukwargs((tgetattrR9R<Rtformat_callR&(RGtfuntlowtl_funtf_call((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR_�scC@s4tjj|j��}tjjj|j|��S(uF
        List all available sizes in configured cloud systems
        (R9tcloudtMapR[R<tdatatsimple_types_filtert	size_list(RGRMtmapper((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
list_sizesscC@s4tjj|j��}tjjj|j|��S(uG
        List all available images in configured cloud systems
        (R9RbRcR[R<RdRet
image_list(RGRMRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytlist_images
scC@s4tjj|j��}tjjj|j|��S(uJ
        List all available locations in configured cloud systems
        (R9RbRcR[R<RdRet
location_list(RGRMRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytlist_locationssu
list_nodescC@s2tjj|j��}d|jd<|j|�S(u2
        Query basic instance information
        u
list_nodesuselected_query_option(R9RbRcR[R8tmap_providers_parallel(RGt
query_typeRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytquerys
ulist_nodes_fullcC@s2tjj|j��}d|jd<|j|�S(u0
        Query all instance information
        ulist_nodes_fulluselected_query_option(R9RbRcR[R8Rm(RGRnRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
full_query's
ulist_nodes_selectcC@s2tjj|j��}d|jd<|j|�S(u3
        Query select instance information
        ulist_nodes_selectuselected_query_option(R9RbRcR[R8Rm(RGRnRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytselect_query/s
ulist_nodes_mincC@s2tjj|j��}d|jd<|j|�S(u3
        Query select instance information
        ulist_nodes_minuselected_query_option(R9RbRcR[R8Rm(RGRnRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt	min_query7s
cK@s}|si}n||d<tjj|j|��}t|tj�rX|jd�}ntjj	j
|j||d|��S(uY
        Pass in a profile to create, names is a list of vm names to allocate

            vm_overrides is a special dict that will be per node options
            overrides

        Example:

        .. code-block:: python

            >>> client= salt.cloud.CloudClient(path='/etc/salt/cloud')
            >>> client.profile('do_512_git', names=['minion01',])
            {'minion01': {'backups_active': 'False',
                    'created_at': '2014-09-04T18:10:15Z',
                    'droplet': {'event_id': 31000502,
                                 'id': 2530006,
                                 'image_id': 5140006,
                                 'name': 'minion01',
                                 'size_id': 66},
                    'id': '2530006',
                    'image_id': '5140006',
                    'ip_address': '107.XXX.XXX.XXX',
                    'locked': 'True',
                    'name': 'minion01',
                    'private_ip_address': None,
                    'region_id': '4',
                    'size_id': '66',
                    'status': 'new'}}


        uprofileu,tvm_overrides(R9RbRcR[t
isinstanceR
tstring_typesRDR<RdRetrun_profile(RGROtnamesRsRRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRO?s 	
cK@sii}|r||d<n|j|�tjj|j|��}|j�}tjjj|j	|��S(u"
        To execute a map
        umap(
RCR9RbRcR[tmap_dataR<RdRetrun_map(RGRHRtkwargRgtdmap((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytmap_runis

cC@s^tjj|jdt��}t|tj�rB|jd�}ntj	j
j|j|��S(u'
        Destroy the named VMs
        tdestroyu,(
R9RbRcR[R%RtR
RuRDR<RdReR}(RGRwRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR}ws
c	K@s�tjj|j��}|jd}||krZ|djttj||���7}nt	St
|tj�r�|jd�}ni}xd|D]\}|j
�}||d<||d<d|d<||d<tjjj|j|��||<q�W|S(	uM
        Create the named VMs, without using a profile

        Example:

        .. code-block:: python

            client.create(provider='my-ec2-config', names=['myinstance'],
                image='ami-1624987f', size='t1.micro', ssh_username='ec2-user',
                securitygroup='default', delvol_on_destroy=True)
        u	providersu:{0}u,unameudriveruprofileuproviderN(R9RbRcR[R8RRER
RFRTRtRuRDRSRR<RdRetcreate(	RGRMRwRRgRYRRLtvm_((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR~�s"
)




c
K@s�tjj|j��}|j�}||krY|djttj||���7}nt	St
|tj�r�|jd�}ni}xd|D]\}|j
�}	||	d<||	d<d|	d<||	d<tjjj|j|	��||<q�W|S(u�
        Perform actions with block storage devices

        Example:

        .. code-block:: python

            client.extra_action(names=['myblock'], action='volume_create',
                provider='my-nova', kwargs={'voltype': 'SSD', 'size': 1000}
            )
            client.extra_action(names=['salt-net'], action='network_create',
                provider='my-nova', kwargs={'cidr': '192.168.100.0/24'}
            )
        u:{0}u,unameuprovideruprofileuactionN(R9RbRcR[RmRRER
RFRTRtRuRDRSRR<RdRetextras(
RGRwRMtactionRRgRYRRLtextra_((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytextra_action�s")




cC@s�|dkri}ntjj|jd|d||��}|rc|rWtd��n|g}n|r�|r�||jd<|j||�S|r�|r�|j|||�Std��dS(uD
        Execute a single action via the cloud plugin backend

        Examples:

        .. code-block:: python

            client.action(fun='show_instance', names=['myinstance'])
            client.action(fun='show_image', provider='my-ec2-config',
                kwargs={'image': 'ami-10314d79'}
            )
        R�RwuMPlease specify either a list of 'names' or a single 'instance', but not both.uactionuTEither an instance (or list of names) or a provider must be specified, but not both.N(	RR9RbRcR[RR8t	do_actiontdo_function(RGR^tcloudmapRwRMtinstanceRRg((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR��s$	


N(t__name__t
__module__t__doc__RRQR[R_RhRjRlRoRpRqRrROR|R}R~R�R�(((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR7�s,	(				*		'	&tCloudcB@seZdZd�Zd�Zd�Zd�Zded�Zded�Z	dedd�Zd	�Zd
d�Z
d
d�Zd
d
�Zd
d�Zd
d�Zd�Zed�Zd�Zed�Zed��Zd�Zdd�Zd�Zd�Zd�ZRS(u/
    An object for the creation of new VMs
    cC@s8||_tjj|j�|_|j�i|_dS(N(R8R9tloadertcloudst$_Cloud__filter_non_working_providerst_Cloud__cached_provider_queries(RGR8((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRQs	
cC@s�t�}xstj|jd�D][\}}t|�dkrnx'|D]}|jdj||��qEWq n|j|�q W|S(u1
        Return the configured providers
        u	providersiu{0}:{1}(tsetR
RAR8tlentaddR(RGRYtaliastdriversRN((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytget_configured_providerss	#
cC@s�|dkrd}n|dkr�t�}xHtj|jd�D]0\}}x!|D]}|j||f�qTWqAW|s�td��n|Sd|kr|jd�\}}||jdks�||jd|krtdj|dj	|j
�����qnt�}x]tj|jd�D]E\}}x6|D].}|||fkr9|j||f�q9q9Wq&W|s�tdj|dj	|j
�����n|S(	u@
        Get a dict describing the configured providers
        uallu	providersu(There are no cloud providers configured.u:u0No cloud providers matched '{0}'. Available: {1}u, u;No cloud providers matched '{0}'. Available selections: {1}N(RR�R
RAR8R�RRDRR(R�(RGtlookupRYR�R�RN((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytlookup_providerss8		#
$	#
!c
C@s1|dkrd}n|dkr*d}n|dkr-t�}t�}x�tj|jd�D]�\}}|jd�}|r_|jd�d}|jd�d}	||kr�|j||f�n"|	|kr�|j||	f�n|j||f�q_q_W|std��n|dkr)|S|SdS(	uH
        Return a dictionary describing the configured profiles
        ualluprofilesuprovideru:iiu'There are no cloud profiles configured.N(	RR�R
RAR8R&RDR�R(
RGRMR�tprofilestprovider_profilesR�tinfoRYtgiven_prov_nametsalt_prov_name((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytlookup_profilesEs.				#u
list_nodesc

C@sh|tkr&||jkr&|j|Si}x(tj|jd�D]\}}xtj|�D]�\}}dj||�}||jkr�tjd|�q_n||kr�i||<nyTt	j
jj|j|ddj
||g���|j|�|||<WdQXWq_tk
rN}	tjd||	dtj�g|||<q_Xq_WqCW||j|<|S(	u�
        Return a mapping of what named VMs are running on what VM providers
        based on what providers are defined in the configuration and VMs
        u	providersu{0}.{1}u)Public cloud provider %s is not availablet__active_provider_name__u:Nu=Failed to execute '%s()' while querying for running nodes: %stexc_info_on_loglevel(R%R�R
RAR8RR�R!R"R9R<tcontexttfunc_globals_injectR(RtdebugtloggingtDEBUG(
RGRotcachedtpmapR�R�RNtdetailsR^terr((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
map_providersgs0#

"	

cC@s�|tkr&||jkr&|j|S|jj�}g}|j|d�|d<x�tj|d�D]�\}}|}x�tj|�D]�\}}	|jd�dkr�dj	|�|j
kr�d}ndj	||�}
|
|j
krtjd|�q�n|j
i|
d6|d6|d	6|d
6|d6�q�WqfWi}|sI|St|�}tj|dkrm|ppdt�}
tt|d
|
�}xJ|D]B\}}}	|	s�q�n||kr�i||<n|	|||<q�W||j|<|S(u�
        Return a mapping of what named VMs are running on what VM providers
        based on what providers are defined in the configuration and VMs

        Same as map_providers but query in parallel.
        u	providersuselected_query_optionu{0}.list_nodes_minulist_nodes_minu{0}.{1}u)Public cloud provider %s is not availableufunuoptsuqueryualiasudriveri
R.N(R%R�R8RSt_optimize_providersR
RAR&RRR�R!R"tappendR�RRtinit_pool_workerR6t!_run_parallel_map_providers_query(RGRoR�R8tmultiprocessing_dataR�R�t
this_queryRNR�R^toutputt
data_countR.t
parallel_pmap((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRm�sJ -				

cC@s�t|tj�r|g}ni}i}|j|d|�}x�tj|�D]�\}}	x|tj|	�D]k\}
}|
|kr�|||
<n|r�||jd|djd�dkr�qknxtj|�D]�\}}
||kr�q�n�|
dkr<d|kr<d||dkr<|||ddkr<q�nJ|
dkr�d|kr�d||dkr�|||ddkr�q�n||kr�i||<n|
||kr�i|||
<n|
|||
|<q�WqkWqOW|S(NR�uprofilesuprovideru:iuec2uaws(RtR
RuRmRAR8RD(RGRwRoR�ROtmatchesthandled_driverstmapped_providersR�R�RNtvmstvm_nameR�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytget_running_by_names�s8
	.
cC@sui}i}xdtj|�D]S\}}xDtj|�D]3\}}||kr]i||<n||||<q8WqWx�tj|�D]�\}}dj|�}	|	|jkr
tjd|�xDtj|�D]3\}}
||kr�i||<n|
|||<q�Wq�n|j|	|�}|r�xGtj|�D]3\}}
||krXi||<n|
|||<q3Wq�q�W|S(uD
        Return an optimized mapping of available providers
        u{0}.optimize_providersu0The '%s' cloud driver is unable to be optimized.(R
RARR�R!R�(RGRYt
new_providerstprovider_by_driverR�RNRLRdtproviders_dataR^t	prov_datatnew_data((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR��s.


uallcC@si}|j|�}|s|Sx�|D]�\}}dj|�}||jkritjd||�q&n||kr�i||<nyTtjjj|j|ddj	||g���|j|�|||<WdQXWq&t
k
r}tjd||dtj
�q&Xq&W|S(uO
        Return a mapping of all location data for available providers
        u{0}.avail_locationsubThe '%s' cloud driver defined under '%s' provider alias is unable to get the locations informationR�u:Nu&Failed to get the output of '%s()': %sR�(R�RR�R!R�R9R<R�R�R(RR"R�R�(RGR�RdtlookupsR�RNR^R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRks.


"cC@si}|j|�}|s|Sx�|D]�\}}dj|�}||jkritjd||�q&n||kr�i||<nyTtjjj|j|ddj	||g���|j|�|||<WdQXWq&t
k
r}tjd||dtj
�q&Xq&W|S(uL
        Return a mapping of all image data for available providers
        u{0}.avail_imagesu_The '%s' cloud driver defined under '%s' provider alias is unable to get the images informationR�u:Nu&Failed to get the output of '%s()': %sR�(R�RR�R!R�R9R<R�R�R(RR"R�R�(RGR�RdR�R�RNR^R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRi<s.


"cC@si}|j|�}|s|Sx�|D]�\}}dj|�}||jkritjd||�q&n||kr�i||<nyTtjjj|j|ddj	||g���|j|�|||<WdQXWq&t
k
r}tjd||dtj
�q&Xq&W|S(uL
        Return a mapping of all image data for available providers
        u{0}.avail_sizesu^The '%s' cloud driver defined under '%s' provider alias is unable to get the sizes informationR�u:Nu&Failed to get the output of '%s()': %sR�(R�RR�R!R�R9R<R�R�R(RR"R�R�(RGR�RdR�R�RNR^R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRfbs.


"cC@sti}|j|�}|s|SxN|D]F\}}||krKi||<n|||kr&i|||<q&q&W|S(uL
        Return a mapping of all image data for available providers
        (R�(RGR�RdR�R�RN((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
provider_list�s
cC@swi}|j||�}|s"|SxN|D]F\}}||krNi||<n|||kr)i|||<q)q)W|S(u=
        Return a mapping of all configured profiles
        (R�(RGRMR�RdR�R�RN((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytprofile_list�s
cC@sNg}xAtj|jd�D])\}}|ji|j|�|6�qW|S(u6
        Create/Verify the VMs in the VM data
        uprofiles(R
RAR8R�R~(RGRR�t
vm_details((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
create_all�s
#cC@s~i}t|�}|j|d|�}t�}g}x�tj|�D]�\}}x�tj|�D]~\}	}
xo|
D]g}||kru|j||	|f�|jdr�|ji|jd6|d6|d6|	d6�q�ququWqbWqFW|jdr
|r
d|jkr|jd}nt|�}tj	d|�t
t|d	|�}
i}x|
D]}|j|�qXWx�|D]�}|d}|d}	|d}||kr�i||<n|	||kr�i|||	<n|||||	|<||krv|j
|�qvqvWn�tj	d
�x�|D]�\}}	}dj|	�}tjjj|j|dd
j||	g���|j||�}WdQX||kr�i||<n|	||kr�i|||	<n||||	|<||kr!|j
|�q!q!Wx%|D]\}}	}|||	|}|s*q�ni|d6dd6d
j||	g�d6|	d6}tjjd||jdi�}tjj|jdd|jd|��}tjdj|��}tjj|�r|rt|t�r�d|kr�tjjj |jd|d�q�q�ntjj|�rf|rftjjj |jdtjj!|��q�ntjj|�r�|r�t|�dkr�tjjj |jdtjj!|d��q�nt"dj|��x@t#rx<t$|�D].\}}t"dj|tjj!|���q�Wt%d�}yt&|�}Wn$t'k
rat"dj|��nXytjj!|j(|��}Wnt)k
r�q�nXt%dj|��}|dks�|j*�j+d �rtjjj |jd|�t"d!j|��Pnt"d"j|��Pq�Wq�W|rL|rLt,d#jd$j|����n.|re|re||d%<n|szt,d&��n|S('u'
        Destroy the named VMs
        R�uparalleluoptsunameualiasudriveru	pool_sizeu0Destroying in parallel mode; Cloud pool size: %sR/u Destroying in non-parallel mode.u{0}.destroyR�u:Nuprofileuprovideruminiontdefaultupki_diruminionsuidu{0}.*unewnameiiukThere are several minion keys who's name starts with '{0}'. We need to ask you which one should be deleted:u	 {0}: {1}u,Which minion key should be deleted(number)? u'{0}' is not a valid selection.uDelete '{0}'? [Y/n]? uuyu
Deleted '{0}'uDid not delete '{0}'u&The following VM's were not found: {0}u, u	Not FounduNo machines were destroyed!(-R�R�R
RAR�R8R�R�R!R�R6t_destroy_multiprocessingRCtremoveRR9R<R�R�R�R(RR:tget_cloud_config_valuetosRHR&tglobtisfileRttdictRbt
remove_keytbasenametprintR%t	enumerateRtintt
ValueErrorRBRtlowert
startswithR(RGRwR�t	processedtmatchingtvms_to_destroyt
parallel_dataR�R�RNR�RLR/t
output_multipt
ret_multiptobjR^RRtminion_dicttkey_filetglobbed_key_filetidxtfilenamet	selectiontdelete((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR}�s�	

	
	









		")+

			
	
!	

cC@s�g}|j�}i}xXtj|�D]G\}}g||<x.|D]&}||krE||j|�qEqEWq(Wx^tj|�D]M\}}dj|�}	x/|D]'}
|ji|j|	|
�|
6�q�Wq�W|S(u&
        Reboot the named VMs
        u
{0}.reboot(RmR
RAR�RR�(RGRwRR�tactstprovtnodestnodetnames_R^RL((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytrebootls


	 cC@s�i}tjjd||jdi�}|djd�\}}dj|�}||jkr�tjd|d|d|�dStjjd	||j�}tjjd
||j�}	|r\|	r�d|kr�tj	d|d�nd
|krpd|krptj
d|d�tjjj
tjjd||j��\}
}||d
<|
|d<qpnd|d
<d|d<|jd|d�}|jd�}
|jd�r�|
r�|
|d<nd|kr�dj||dg�}n|	tkr^d|kr^d|kr^tj
d|d�tjjj
tjjd||j��\}}||d<||d<n|tkr�|tkr�tjjj|jd|d
|�ntjjd||j�|d<y#tjjd||j�|d<Wntk
r�nXy�|djd�\}}dj|�}tjjj|j|ddj||g���|j||�}WdQX|tk	r�d|jkr�|jdd4kr�tjd#�|Stjd$�ttj��}x�ttj��|d%kr�tjj}d&j|jd'jd&�d( �}|jtjjtjj|d���tjj d)|�}|j!|dd*j|jd�d+|jd,�}|r�tj"t#j$d-�j|��Pq�q�WnWn*tk
r�}tj%d.|d|�nXy|jd/}Wntk
r
t}nX|jd0r�|jd1r�|r�tj"d2|jd1|d�tjj d)|j�}|j!|d|jd1d+|jd,d%�}||d3<n|S(5u$
        Create a single VM
        uminionR�uprovideru:u
{0}.createuTCreating '%s' using '%s' as the provider cannot complete since '%s' is not availableunameNudeployumake_masterumasteru2There's no master defined on the '%s' VM settings.upub_keyupriv_keyuGenerating minion keys for '%s'ukeysizeuidudomainuuse_fqdnu
append_domainu.u
master_pubu
master_pemu#Generating the master keys for '%s'upki_diruscriptuosu
inline_scriptR�usync_after_installuallumodulesustatesugrainsu!Bad option for sync_after_installii<u/u	conf_filei����tmoptsusaltutil.sync_{0}ttimeoututimeoutu1Synchronized the following dynamic modules:   {0}u>Failed to create VM %s. Configuration value %s needs to be setumapuparallelustart_actionuRunning %s on %suret(uallumodulesustatesugrains(&R9R:R�R8RDRR�R!R"twarningR�R<Rbtgen_keysRR&R(R%t
accept_keytKeyErrorR�R�RTR*R+R�tDEFAULT_MASTER_OPTSRCt
master_configR�RHtclienttget_local_clienttcmdR�R
tut	exception(RGRtlocal_masterR�R�R�RNR^tdeploytmake_mastertprivtpubtkey_idtdomaintmaster_privt
master_pubRtstarttmopts_t	conf_pathR�Rtexctopt_mapt
action_out((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR~�s�			



$	

		


	

#	



!

cC@sW|j�}tjjj||�}tjjj||�}|j|�||d<|S(u
        Create vm config.

        :param str name: The name of the vm
        :param dict main: The main cloud config
        :param dict provider: The provider config
        :param dict profile: The profile config
        :param dict overrides: The vm's config overrides
        uname(RSR9R<t
dictupdateRC(RLtmainRMROt	overridestvm((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt	vm_configs

cC@s�i}|djd�\}}dj||d�}||jkrftjd|d|d|�dSyDtjjj|j|d|d��|j||�}WdQXWn8t	k
r�}tj
d	|d|d|d|�nX|S(
u
        Extra actions
        uprovideru:u{0}.{1}uactionuTCreating '%s' using '%s' as the provider cannot complete since '%s' is not availableunameNR�uEFailed to perform %s.%s on %s. Configuration value %s needs to be set(RDRR�R!R"R9R<R�R�R�R�(RGR�R�R�RNR^R((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR�0s$
 cC@s~||jdkr:dj|�}tj|�i|d6Si}|sOi}nyPtjjj|jdd��}tjjj	|�}WdQX|s�i}nWn-t
k
r�i}ntk
r�i}nX|dkr�i}n|j
�}|jd|}	i}
xztj|�D]i\}}tt|��}
xH|||
D]8}|||
||
|<||
|d<|
|
|d<qDWqW|	djd	�\}}|jd
||j�}|d=x�|D]�}||
kr-|
|d}|
|d}dj|||�}tj|�i|d6||<q�n|j||||	|�}|jdr�tjd
|jd|f�}|j�idj|j�d6||<q�ny�|j|�||<||s�idd6||<t|�dkr�td��nw�n|jjdt�tkr*||jdd�nWq�ttfk
ru}t|�dkr[�nit |�d6||<q�Xq�W|S(ul
        Parse over the options passed on the command line and determine how to
        handle them
        uprofilesuProfile {0} is not defineduErroru	conf_fileurNuproviderudriveru:u	providersu {0} already exists under {1}:{2}uparallelR,Ru*VM being provisioned in parallel. PID: {0}uProvisioninguFailed to deploy VMiushow_deploy_argsu
deploy_kwargs(!R8RR!R"R9R<tfilestfopentyamlt	safe_loadR�tIOErrorRRmR
RAREtiterRDRSRRtProcessR~R�tpidR�RR&RTRBRtstr(RGRORwRsR2Rtmcctmain_cloud_configR�tprofile_detailsR�R�tvalt	prov_nameR�R�RNtprovider_detailsRLtdrivRtprocessR((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRvNs�
	"

	

	

	
		

c
C@sOi}i}t|�}xjtj|j��D]S\}}|sDPnx:tj|�D])\}}|sjPnt}	dj||jd�}
|
|jkr�tj	d|
�t
}	nx�tj|�D]�\}}|s�Pn||kr@t|t�s�i}nd|kr$|d|kr$|d}q@tj
d|||�q�n|	t
kr�|j|
�d	krx|jig|
6�n||
j|�q�ntjjj|j|
ddj||g����||kr�i||<n|||kr�i|||<ntjjj|�}|rA|j|
||dd�||||<n%|j|
|dd�||||<|j|�Wd	QXq�WqTWq.Wt�}
|r||d
<t�}x2tj|�D]!\}}|jt|��}q�W|j|�}
|
rt|
�|d<t|�|d<qn|s!|S|
r+|St|�|d<t|�|d<|S(
uX
        Perform an action on a VM which may be specific to this cloud provider
        u{0}.{1}uactionu)'%s()' is not available. Not actioning...uidu-vm:%s in provider:%s is not in name list:'%s'R�u:tcallNuInvalid Actionsu	Not FounduNot Actioned/Not Running(R�R
RARmR%RR8R�R!R�RTRtR�R�R&RRCR�R9R<R�R�R(Rtclean_kwargsR�tuniont
differencetlist(RGRwRRtinvalid_functionsR�R�RNR�tvalid_functionR^R�R�tmissing_vmstinvalid_func_vmstkeyR((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR��s|"		




!
	
	cC@sZ|j|�}t|�dkrjtdj|djg|D]\}}dj||�^q:����n|j�\}}dj||�}||jkr�tdj|||���ntjd||�t	j
jj|j|dd	j||g���U|r.ii|j|d
dd|�|6|6Sii|j|d
d�|6|6SWd
QXd
S(u=
        Perform a function against a cloud provider
        iu?More than one results matched '{0}'. Please specify one of: {1}u, u{0}:{1}u{0}.{1}uXThe '{0}' cloud provider alias, for the '{1}' driver, does not define the function '{2}'u4Trying to execute '%s' with the following kwargs: %sR�u:RufunctionRN(
R�R�RRR(RBR�R!R�R9R<R�R�(RGR�RRR�R�RNR^((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR�s84


c
C@s�x�tj|jdj��D]y\}}x)|j�D]}dj|�}||jkr�tjd|||||�|jd|j|�||jdkr�q6n|jd|s6|jdj|�q6q6nt	j
jj|j|ddj
||g���I|j|�tkrKtjd||�|jd|j|�nWdQXq6W||jdkrnqn|jd|s|jdj|�qqWdS(uV
        Remove any mis-configured cloud providers from the available listing
        u	providersu{0}.get_configured_provideruNThe cloud driver, '%s', configured under the '%s' cloud provider alias, could not be loaded. Please check your provider configuration files and ensure all required dependencies are installed for the '%s' driver.
In rare cases, this could indicate the '%s()' function could not be found.
Removing '%s' from the available providers listR�u:u�The cloud driver, '%s', configured under the '%s' cloud provider alias is not properly configured. Removing it from the available providers list.N(R
RAR8RSRR�R!R�RBR9R<R�R�R(RT(RGR�R�RNR^((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt__filter_non_working_providers5s2)

%N(R�R�R�RQR�R�R�RTR�RmRR�R�RkRiRfR�R�R�R}R�R%R~tstaticmethodRR�RvR�R�R�(((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR�s2		
	,	"$:-	"'&&	
�	�	Y	^	0RccB@sqeZdZd�Zded�Zdd�Zd�Zd�Z	ddd�Z
d�Zed	�Zd
�Z
RS(u3
    Create a VM stateful map execution object
    cC@s#tj||�|j�|_dS(N(R�RQtreadtrendered_map(RGR8((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRQjsu
list_nodesc	C@s)|j�j�}i}x
tj|�D]�\}}t|�}||jdkr�d|krli|d<ndj|dj|��}tj	|�||d|<q(n|j
|||�}	x�tj|	�D]�\}
}x�tj|�D]�\}}
x�tj|
�D]}\}}|
|kr*i||
<n|||
krKi||
|<n|||
||<y|j|�Wqtk
r�qXqWq�Wq�W|s�q(n|jd|}|dj
d�\}
}xZ|D]R}|
|kr�i||
<n|||
kri||
|<nd||
||<q�Wq(W|S(NuprofilesuErrorsuDNo provider for the mapped '{0}' profile was found. Skipped VMS: {1}u, uprovideru:uAbsent(R%RSR
RAR�R8RR(R!R�R�R�R�RD(RGRoR�R&tinterpolated_mapROt
mapped_vmsRwR2R�R�R�RNR�R�R�R((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR'nsH





c	C@s�|jd|�}x�tj|j��D]�\}}x�tj|j��D]x\}}xGtj|j��D]0\}}|dkrl|||j|�qlqlW|||sJ||j|�qJqJW||s(|j|�q(q(W|S(NRouAbsent(R'R
RARSRB(	RGRot	query_mapR�R�RNR�R�R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt
delete_map�s"""
cC@s|jd�}idgd6ddgd6ddgd6}g}x�tj|�D]�\}}x�tj|�D]�\}}x�tj|�D]y\}	}
y||}Wn*tk
r�tjd|�t��nX|
d	kr�|
d
j�|kr�|j|	�q�q�WqkWqOW|S(Nu
list_nodesustoppedustarturunninguactiveustopurebootuxThe use of '%s' as an action is not supported in this context. Only 'start', 'stop', and 'reboot' are supported options.uAbsentustate(	R'R
RAR�R!R"RR�R�(RGR�R)tmatching_statestvm_namesR�R�RNR�R�R�tstate_action((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytget_vmnames_by_action�s&



"c	C@s5d}|jjdd�dkr�|jjdd�dkr�|jjdd�dkrZq�|jjd�|jjd�kr�tjd|jd�t��q�|jd|jjd�}qr|jd}n�tj|j�}d|d<tj	j
|�|_	tjj
|jd�sW|jdjd�sWtjd	|jd�t��qWn|jdjd�r�|j	jd
|jd�}n
|jd}ym|jjdd�}tjj|ji�}|jjd
�}|jjd�}t|||||�}Wn7tk
r@}tjd|jd|dtj�iSXd|krrtjj||jddt�}n|s|iSx�tj|j��D]�\}	}
t|
ttf�r�i}x�|
D]�}t|tj�r�id|6}nx�tj|�D]p\}
}|dkst|t�r(i}ny|j d|
�Wnt!k
r]tjd�iSX|||
<q�Wq�W|||	<q�nt|
t"�r�i}x7tj|
�D]&\}
}|j d|
�|||
<q�W|||	<q�nt|
tj�r�|
g}
ni||	<x#|
D]}
i|
d6||	|
<qWq�W|S(uH
        Read in the specified map and return the map structure
        umapumap_datau
map_pillarumapsu8The specified map not found in pillar at 'cloud:maps:%s'ulocalufile_clientusalt://u+The specified map file does not exist: '%s'u
cp.cache_fileurendereru
jinja|yamlurenderer_blacklisturenderer_whitelistu)Rendering map %s failed, render error:
%sR�uincludetverboseunameu�Cannot use 'name' as a minion id in a cloud map as it is a reserved word. Please change 'name' to a different minion id reference.N(#RR8R&R!R"RRStdeepcopyR9tminiontMasterMinionR�RHR�R�t	functionsR�trenderR	RR�R�R:tinclude_configRTR
RARtRttupleRutboolt
setdefaulttAttributeErrorR�(RGtmap_tlocal_minion_optst
cached_maptrenderertrendt	blacklistt	whitelistRROtmappedtentriestmappingRLR((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR%�s�$ 
 

	"
	

	


cC@s|dkr�xtj|d�D]j}g}y|d}Wntk
rSg}nXx3|D]+}|j|dt|�d|�r[tSq[Wq Wn�||kr�tS|j|�y|d|d}Wntk
r�g}nXx3|D]+}|j|dt|�d|�r�tSq�WtS(NucreateurequirestseenR(	RR
RUR�t	_has_loopRR%R�RT(RGR{RDRtvaluestmachinestmachine((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRE;s*


!



!c	C@s�y|d}Wntk
r"|SXg}x�|D]�}y|d|}WnVtk
r�y|d|}Wq�tk
r�d}tj|�t|��q�XnX|j|j||||��q0Wt|�d}|S(NurequiresucreateuexistinguMissing dependency in cloud mapi(R�R!R"RR�t_calcdeptmax(	RGR{RHRdtleveltdeplisttlevelsRLR2((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRIUs$




#c
@sLiid6}|jd|��t�}t�}tj|j�}x�tj|�D]�\}}||jdkr�dj|dj	d�|D���}t
j|�d|kr�i|d<n||d|<qSn|jdj|�}	x�tj|�D]�\}
}d|krD|d|	dkrD|jd�j
d	�\}}
n|	jd�j
d	�\}}
tj|jd
||
�}|d=tjjj||	�tj|�}xUdD]M}dj|�}||kr�t
jd||
|�|j|�||<q�q�Wd
|kr{d
|kr{d|d
kr{d|d
kr{|d
dj|d
d�|d
d=|d
s{|d
=q{ntjjj||�}||d|
<|dj
d	�\}}
|j||
|
f�q�WqSW�fd�}x
tj��D]�\}}x�tj|�D]�\}
}x�tj|�D]�\}}|j||
|f�||dkrgq/n||�}|sq/nxf|D]^}||dkr�Pnt
jd|�d|kr�i|d<n|dj|�|d|<q�Wq/WqWq�Wd|jkrH|jdrH|jdtkr2td��n|j|�|d<n|S(u9
        Create a data map of what to execute on
        ucreateR�uprofilesulThe required profile, '{0}', defined in the map does not exist. The defined nodes, {1}, will not be created.u, cs@s|]}dj|�VqdS(u'{0}'N(R(t.0R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pys	<genexpr>ysuerrorsuprovideru:u	providersugrainsumasteruminionuvolumesurequiresumap_{0}u�The use of '%s' on the '%s' mapping has been deprecated. The preferred way now is to just define '%s'. For now, salt-cloud will do the proper thing and convert the deprecated mapping into the preferred one.c@s�i}x�tj��D]u\}}xftj|�D]U\}}xFtj|�D]5\}}||krN||krN|d||<qNqNWq2WqW|S(Nustate(R
RA(RLR�R�R�RNR�R�R�(R�(s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytget_matching_by_name�su2'%s' already exists, removing from the create map.uexistinguharduenable_hard_mapsu�The --hard map can be extremely dangerous to use, and therefore must explicitly be enabled in the main configuration file, by setting 'enable_hard_maps' to Trueudestroy(ugrainsumasteruminionuvolumesurequires(RmR�RSR0R&R
RAR8RR(R!R"R&RDR9R<RRCR�RBR�RTRR(RGR�RtexisttdefinedR&tprofile_nameR�R2tprofile_datatnodenameRR�RNRtnodedatatsettingt
deprecatedROR�R�RLR�R�titem((R�s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRxis�
		

 !



	
	
+c$C@s�	|j|�r1d}tj|�t|��nxttj|d�D]_\}}tjd|�d}|j||||�}tjd||�||d|d<qEWytj|d�}Wn t	k
r�tji�}nXxg|D]_\}}tjd|�d}|j||||�}tjd||�||d|d<q�Wt
tj|d�dd	��}i}|jd
r�g}	nd}
d}d}d}
y�t
d�|D��\}
}|
}tjd|
�tjjd
||j�tkrtd��ntjd|d�tjjjtjjd||j��\}}||d<||d<tjjj�}tjjj|d��}|j|�WdQXtjjj|d|jd�}
tj|�|jdt�tkrT|j di�d|dkr|dd}nd|dkrTd|dd<|
dk	rQ|
|d<qQqTnx�|D]�\}}tjjd||jdt�}|tkr�q[ntjd|d�tjjjtjjd||j��\}}||d <||d!<|j d"i�|d"j!i||6�q[Wt}|djd#t�r_|djdd�dk	r_t}n|j"|d$|�}t#|t$�s�tjd%j%|��n(d&|kr�td'j%|d&���n|jjd(t�tkr�|jd)i�p|j&d)i�}|jd*|jd+d��}|dkrEtd,j%|
���n|||
<Wnqt'k
r�tjd-�tj(j)|jd.d/�}tj(j*|�r�tjjj|d|jd�}
q�nX|jj+�}|jd
r�tjd0�t|d1<n|
dk}x�|D]�\}}||
|fkr1q
nd|krx|djd#t�rx|djdd�dk	rxt}n|
dk	r�|tkr�|
|d<n|dk	r�|j di�|dj d|�n|jd
r|	j,i|d26|d6|d36|d#6�q
nyn|j"|d$|�||<|jjd(t�tkryd)|kryt#||t$�ry||j&d)d�nWq
tk
r�}tjd4||d5t-j.�it/|�d66||<q
Xq
Wx-|jd7dH�D]}|j0|�||<q�W|jd
r�	|	r�	d8|jkr)|jd8}nt1|	�}tjd9|�t2t3|	d:|�}|jd;r�	g}d<}xjt4tj5|d�d=��D]I\}}|j,g�|d>7}x#|D]} ||j,| d�q�Wq�Wi}x�|D]x}!tjd?|jd;d@j)|!��tj6j7�}"|j!|"j8dAj)|!�|jd;dB|jdCdDdEdF��q�Wxh|D]?}#|t
tj9|#��t
tj5|#��dG<|j!|#�qp	Wq�	x|D]}#|j!|#�q�	Wn|S(Iu4
        Execute the contents of the VM map
        u,Uh-oh, that cloud map has a dependency loop!ucreateuCalculating dependencies for %siuGot execution order %s for %suleveluexistingR"cS@s|ddS(Niulevel((tx((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt<lambda>suparallelcs@s9|]/\}}|jdt�tkr||fVqdS(umake_masterN(R&RTR%(RNRLRO((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pys	<genexpr>s	uCreating new master '%s'udeployuTCannot proceed with 'make_master' when salt deployment is disabled(ex: --no-deploy).uGenerating master keys for '%s'unameukeysizeu
master_pubu
master_pemuwNtsum_typeu	hash_typeumake_minionuminionuidumasteru	127.0.0.1u
master_fingerR�uGenerating minion keys for '%s'upub_keyupriv_keyupreseed_minion_keysulocal_masterR�u0Master creation details is not a dictionary: {0}uErrorsu@An error occurred while creating the master, not continuing: {0}ushow_deploy_argsu
deploy_kwargsu	salt_hostuhostu3Host for new master {0} was not found, aborting mapuNo make_master found in mapupki_diru
master.pubuiSince parallel deployment is in use, ssh console output is disabled. All ssh output will be logged thoughudisplay_ssh_outputuoptsuprofileu Failed to deploy '%s'. Error: %sR�uErrorudestroyu	pool_sizeuCloud pool size: %sR/ustart_actioni����cS@s|dS(Nulevel((RY((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRZ�siuRunning %s on %su, u,R�utimeouti<ttgt_typeulisturet((:RER!R"RR
RAR�RIR�R�tsortedR8RRER9R:R�RTRR<RbR�RtmkstempR	twritetcryptt
pem_fingerR�tunlinkR&R%R8RCR~RtR�RRBt
StopIterationRHR(R�RSR�R�R�RR}R�R6t_create_multiprocessingRRUR�R�R�RF($RGR{R2R"RRKt
existing_listtcreate_listR�R�tmaster_nametmaster_minion_nametmaster_hostt
master_fingertmaster_profileR�R�tmaster_temp_pubtmtpRLROtmake_minionR�toutt
deploy_kwargsR�R8RR/R�t
actionlisttgrpRXtgroupR�R�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRy�sR
 
"
					

"
		

	


)

"	

	
,



#
,
N(R�R�R�RQRTR'RR*R.R%RERIRxRy(((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRcfs	0
		u	~cC@stjtjtj�dS(uh
    Make every worker ignore KeyboarInterrup's since it will be handled by the
    parent process.
    N(tsignaltSIGINTtSIG_IGN(((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR��scC@s�tjjj�d|dd<t|d�}y!|j|dd|d�}WnLtk
r�}tjd|d|d	t	j
�iit|�d
6|d6SX|djdt
�t
kr�t|t�r�|jdd
�nitjjj|�|d6S(u�
    This function will be called from another process when running a map in
    parallel mode. The result from the create is always a json object.
    ujsonuoptsuoutputuprofileR�ulocal_masteru Failed to deploy '%s'. Error: %sunameR�uErrorushow_deploy_argsu
deploy_kwargsN(R9R<R`t
reinit_cryptoR�R~RR!R"R�R�RR&RTRtR�RBRRdRe(R�RRbR�R((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytcreate_multiprocessing�s 
+cC@stjjj�d|dd<tjj|d�}yd|dj|d�}tjjj|ddj	|d|dg���||d	�}Wd
QXWnLt
k
r�}tjd|d	|dt
j�iit|�d
6|d	6SXitjjj|�|d	6S(u�
    This function will be called from another process when running a map in
    parallel mode. The result from the destroy is always a json object.
    ujsonuoptsuoutputu{0}.destroyudriverR�u:ualiasunameNuFailed to destroy %s. Error: %sR�uError(R9R<R`RwR�R�RR�R�R(RR!R"R�R�RRdRe(R�RR�R^R�R((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pytdestroy_multiprocessing	s$c
C@s�tjjj�t|d�}yztjjj|j|dddj|d|dg���7|d|dtjj	j
|j|d��fSWdQXWnEtk
r�}tj
d|d|d	tj�|d|dd
fSXdS(u`
    This function will be called from another process when building the
    providers map.
    uoptsufunR�u:ualiasudriverNu=Failed to execute '%s()' while querying for running nodes: %sR�((R9R<R`RwR�R�R�R�R(RdReRR!R�R�R�(RdRRbR�((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt run_parallel_map_providers_query(	s""cO@stt�|d|�S(Ni(RRz(Rtkw((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR�I	scO@stt�|d|�S(Ni(RRy(RR{((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyR�M	scO@stt�|d|�S(Ni(RRx(RR{((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyRdQ	s(AR�t
__future__RRRRR�RSR�R*RtR�RRtsyst	itertoolsRtsalt.exceptionsRRRRtsalt.configR9tsalt.clienttsalt.loadertsalt.utils.argstsalt.utils.cloudtsalt.utils.contexttsalt.utils.crypttsalt.utils.datatsalt.utils.dictupdatetsalt.utils.filestsalt.utils.verifytsalt.utils.yamltsalt.utils.usert
salt.syspathst
salt.templateR	tCryptodome.Randomt
CryptodometImportErrort
Crypto.RandomtCryptotsalt.extR
tsalt.ext.six.movesRt	getLoggerR�R!RRR6tobjectR7R�RcR�RxRyRzR�R�Rd(((s7/usr/lib/python2.7/site-packages/salt/cloud/__init__.pyt<module>s|""

	Z�O����h��~	!!		

Zerion Mini Shell 1.0