%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s3dZddlmZmZmZddlZddlZddlZddlm	Z	ddl
ZddlZddl
ZddlZddljZddlZddlZddlZddlmZmZddlmZmZmZmZddlmZeje�Z dej!j"j#fd	��YZ$dS(
u.
Primary interfaces for the salt-cloud system
i(tabsolute_importtprint_functiontunicode_literalsN(tinput(tSaltCloudExceptiontSaltCloudSystemExit(t
check_usert
verify_envtverify_log_filest
verify_log(tsixt	SaltCloudcB@s#eZd�Zd�Zd�ZRS(c#
C@s$|j�|jjd�}|dFkr=tjjj�}nt|�sh|j	dj
|tj��nyp|jdr�t
tjj|jd�g|d|jd�|jd}|dFk	r�t|g|�q�nWn9ttfk
r}tj	d|�tj|j�nX|j�t|j�|jjr�tjjj|j�}tjj||jjd	|j�|jtjj j!�ntj"d
�ytjj#|j�}WnNt$k
r�}|j%|j&|�n)t'k
r}d}|j%||�nX|jjddF�}|dFk	r�i}	xf|j(D][}
i}x9|j(|
D]*}||krL|j(|
|||<qLqLW|r2||	|
<q2q2W|	|_(ni}|j)dFk	r1|j)d
kry|j*�}Wq.t't+fk
r}d}|j%||�q.Xq�|j)dkri|jj,}
y|j-|
�}Wq.t't+fk
re}d}|j%||�q.Xq�|jjddF�r�tj"d|jd�y|j.d|j)�}Wq.t't+fk
r�}d}|j%||�q.Xq�y|j/d|j)�}Wq�t't+fk
r-}d}|j%||�q�Xn�
|jj0dFk	r�y|j1|jj0�}Wq�t't+fk
r�}d}|j%||�q�XnW
|jj2dFk	r�y|j3|jj2�}Wq�t't+fk
r�}d}|j%||�q�Xn�	|jj4dFk	rQy|j5|jj4�}Wq�t't+fk
rM}d}|j%||�q�Xn�	|jj6r]|jjddF�s�|jjddF�r]|jjddF�}|jjddG�}|dFk	r|dHkr�dj
||�}|j%|t$�ntj"d|�|j7dd�}n|j8|d|jj9�}|sWt:d�|jtjj j!�nd}t;�}x�t<j=|�D]�\}}|dj
|�7}xat<j=|�D]P\}}|dj
|�7}x.|D]&}|d j
|�7}|j>|�q�Wq�WqvWy+|j?|�r'|j6|d!t@�}nWq�t't+fk
rY}d"}|j%||�q�Xn�|jjAr	|jjddF�s�|jjddF�r	|jjddF�rtj"d|jd�y|jB|jjA�}Wqt'k
r}d#}|j%||�qXn|jjddF�}i}g}d$j
|jjA�}x_|D]W}d%|kr{|jCd%d&�\}}|||<qD|d'j
|�7}|jD|�qDW|}y(|j?|�r�|jE||�}nWq�t't+fk
r�}d(}|j%||�q�Xn�|jjFr�	i}|j&}xM|D]D}d%|kr&	|jCd%d&�\}}|||<|jG|�q&	q&	W|r�	|j	d)j
|��ny|jH|jI|jJ|�}Wq�t't+fk
r�	}d*}|j%||�q�Xn|jj9r_
|jjdtK�r_
y(|jL|jj9|jjd��}Wq�t't+fk
r[
}d+}|j%||�q�Xn�|jjMr�
|jN}d,j
|jO�}tjjjP||�nI|jjddF�r�
|j)dFkr�
|j(s�
tjQjRd-�|jtjj jS�nyzi}t@}tj"d|jd�|jT�}d.}d/|kr�|d07}x7t<j=|d/�D]"\}}|d1j
||�7}qWWtjQjR|�tjQjU�nd.}d2|kr�|d37}x(|d2D]}|d'j
|�7}q�Wn|d4r#|d57}x(|d4D]}|d'j
|�7}qWnd6|krd|d7}x(|d6D]}|d'j
|�7}qDWn|d4r�|jd6dF�r�|jd2dF�s�t:|�|jd&�q�tK}n|r
|j?|�r�|jV|�}n|jjd7tK�tKkr
tj"d8�q
n|jd2dF�rn
xM|d2D]>}d9|d2|d:krP
d;}nd<}i|d=6||<q)
WnWq�t't+fk
r�
}d>}|j%||�q�XnD|jjWr�|jjW} |j&r�
d%|j&d?kr�
|j&jXd?�}!n| }!id.d@6| dA6|!dB6}"|j&}xM|D]D}d%|kr |jCd%d&�\}}||"|<|jG|�q q W|r�|j	dCj
|��nytjjjW|"|j�}Wq�t't+fk
r�}dD}|j%||�q�Xn
|j	dE�tjj||jjd	|j�|jtjj j!�dFS(Iu5
        Execute the salt-cloud command line
        uuseru#If salt-cloud is running on a master machine, salt-cloud needs to run as the same user as the salt-master, '{0}'. If salt-cloud is not running on a salt-master, the appropriate write permissions must be granted to '{1}'. Please run salt-cloud as root, '{0}', or change permissions for '{1}'.u
verify_envu	conf_filetroot_diruroot_dirulog_fileu)Error while verifying the environment: %stoptsusalt-cloud startingu)There was an error generating the mapper.unamesulist_providersu)There was an error listing providers: {0}u
list_profilesu(There was an error listing profiles: {0}umapuApplying map from '%s'.tqueryu)There was an error with a custom map: {0}u"There was an error with a map: {0}u)There was an error listing locations: {0}u&There was an error listing images: {0}u%There was an error listing sizes: {0}u�Supplying a mapfile, '{0}', in addition to instance names {1} with the '--destroy' or '-d' function is not supported. Please choose to delete either the entire map file or individual instances.u
list_nodestprofileu&No machines were found to be destroyedu8The following virtual machines are set to be destroyed:
u  {0}:
u	    {0}:
u
      {0}
tcachedu+There was an error destroying machines: {0}u.There was an error actioning virtual machines.uBThe following virtual machines are set to be actioned with "{0}":
u=iu  {0}
u*There was an error actioning machines: {0}upAny arguments passed to --function need to be passed as kwargs. Ex: image=ami-54cf5c3d. Remaining arguments: {0}u,There was an error running the function: {0}uThere was a profile error: {0}usalt.cloud.provider.{0}uNo nodes defined in this mapuuerrorsuFound the following errors:
u  {0}: {1}
uexistingu.The following virtual machines already exist:
ucreateu6The following virtual machines are set to be created:
udestroyuparalleluCompleteuec2uprovideru@Instance already exists, or is terminated and has the same name.uAlready running.uMessageuThere was a query error: {0}iudriverussh_hostunameuqAny arguments passed to --bootstrap need to be passed as kwargs. Ex: ssh_username=larry. Remaining arguments: {0}u0There was an error bootstrapping the minion: {0}u-Nothing was done. Using the proper arguments?N(((Yt
parse_argstconfigtgettNonetsalttutilstusertget_userRterrortformattsyspathst
CONFIG_DIRRtostpathtdirnameRtIOErrortOSErrortlogtsystexitterrnotsetup_logfile_loggerR	toptionstupdate_bootstraptcloudtoutputtdisplay_outputtdefaultst	exitcodestEX_OKtinfotMapRthandle_exceptiontargsRtrendered_maptselected_query_optiont
provider_listt	Exceptiont
list_profilestprofile_listtinterpolated_maptmap_providers_paralleltlist_locationst
location_listtlist_imagest
image_listt
list_sizest	size_listtdestroyt
delete_maptget_running_by_namesRtprinttsetR
t	iteritemstaddt
print_confirmtTruetactiontget_vmnames_by_actiontsplittappendt	do_actiontfunctiontremovetdo_functiontfunction_providert
function_nametFalsetrun_profiletset_passwordtcredential_usernametcredential_providertstore_password_in_keyringtstderrtwritet
EX_GENERICtmap_datatflushtrun_mapt	bootstraptpop(#tselftsalt_master_usertlogfileterrtrettmappertexctmsgtnamestfiltered_rendered_maptmap_profiletfiltered_map_profiletnametprovidertmap_filetmatchingtaliastdriverstdrivertvmstkwargstmachinestkeytvalueR2targtusernamet
provider_nameR_tdmaptprofile_nameRthostt	minion_idtvm_((s2/usr/lib/python2.7/site-packages/salt/cloud/cli.pytrun)s






		!
	
!




!			
 




		





cC@sM|jjrtSt|�td�}|j�jd�s?tStd�tS(NuProceed? [N/y] uyu... proceeding(R't
assume_yesRIRDRtlowert
startswithRT(RbRitres((s2/usr/lib/python2.7/site-packages/salt/cloud/cli.pyRH�s

cC@s�t|t�r�t|t�rh|jdkr?dj|�}n|j|j|j|�j�d�n|j|j|��ntj|j|�dt	j
�|jtjj
j�dS(Niu
Error: {0}u
texc_info_on_loglevel(t
isinstanceRRt	exit_codeRR$trstripRR"tloggingtDEBUGRR,R-R\(RbRiRh((s2/usr/lib/python2.7/site-packages/salt/cloud/cli.pyR1�s
(t__name__t
__module__R�RHR1(((s2/usr/lib/python2.7/site-packages/salt/cloud/cli.pyR's	�e	
(%t__doc__t
__future__RRRRR#R�tsalt.ext.six.movesRt
salt.cloudRtsalt.configtsalt.defaults.exitcodestsalt.outputt
salt.syspathsRtsalt.utils.cloudtsalt.utils.parserstsalt.utils.usertsalt.exceptionsRRtsalt.utils.verifyRRRR	tsalt.extR
t	getLoggerR�R"RtparserstSaltCloudParserR(((s2/usr/lib/python2.7/site-packages/salt/cloud/cli.pyt<module>s$"

Zerion Mini Shell 1.0