MOON
Server: Apache
System: Linux vps.erhabenn.com.br 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User: machen (1008)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyc
�
d�bc@s�ddlZddlZddlZddljjZddljjZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZddlmZmZmZmZdd	lmZdd
lmZddlmZmZmZm Z m!Z!dZ"d
Z#dZ$dZ%dZ&dZ'dZ(de)fd��YZ*de)fd��YZ+de)fd��YZ,de)fd��YZ-de)fd��YZ.dS(i����N(tAgentGlobals(tset_properties(tIncompleteGoalStateError(t
ProtocolError(tustr(tExtensionsGoalStateFactory(tCerttCertListtRemoteAccessUsertRemoteAccessUsersList(tfileutil(t	CryptUtil(t	parse_doctfindalltfindtfindtextt	getattribs"http://{0}/machine/?comp=goalstatesCertificates.xmlsCertificates.p7msCertificates.pemsTransportCert.pemsTransportPrivate.pemit	GoalStatecBseZd�Zd�ZRS(c	Cs�tj|j��}x�tdt�D]h}|j||j��|_t|j�}t	|d�|_
t|d�}|r�Pntj
d�q%Wtdjd|j
���y�t	|d�|_t|d�}t	|d	�|_t|d
�}t	|d�|_tj|j�t	|d�|_d|_t	|d
�|_d|_t	|d�|_d|_t	|d�|_d|_d|_t	|d�|_Wn(tk
r�}t ddd|��nXdS(s�
        Fetches the goal state using the given wire client.

        __init__ fetches only the goal state itself, not including inner properties such as ExtensionsConfig; to fetch the entire goal state
        use the fetch_full_goal_state().
        itIncarnationtRoleInstanceg�?s=Fetched goal state without a RoleInstance [incarnation {inc}]tinct
InstanceIdt
Configurationt
ConfigNamet	ContainertContainerIdtHostingEnvironmentConfigtSharedConfigtCertificatestRemoteAccessInfotExtensionsConfigtmsgsError fetching goal statetinnerN(!tGOAL_STATE_URItformattget_endpointtranget_NUM_GS_FETCH_RETRIEStfetch_configt
get_headertxml_textRRtincarnationRttimetsleepRtrole_instance_idtrole_config_nametcontainer_idRtupdate_container_idt_hosting_env_uritNonethosting_envt_shared_conf_uritshared_conft
_certs_uritcertst_remote_access_urit
remote_accesstextensions_configt_extensions_config_urit	ExceptionR(	tselftwire_clientturit_txml_doct
role_instancetrole_configt	containert	exception((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyt__init__/s:					cCs�zy:tjd|j�|j|j|j��}t|�|_|j|j|j��}t	|�|_
|jdk	r�|j|j|j
��}t|�|_n|jdk	r�|j|j|j
��}t|�|_n|jdkrtj�|_n6|j|j|j��}tj|j||�|_Wn>tk
r}}tjdt|��tddd|��nXWdtjd�XdS(Ns%Fetching goal state [incarnation {0}]s#Fetching the goal state failed: {0}RsError fetching goal stateR sFetch goal state completed(tloggertinfoR)R&R0R't
HostingEnvR2R3RR4R5R1tget_header_for_certRR6R7tRemoteAccessR8R:Rtcreate_emptyR9tcreate_from_extensions_configR;twarnRR(R<R=R(RD((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pytfetch_full_goal_state_s*(t__name__t
__module__RERN(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyR.s	0RHcBseZd�ZRS(cCs|||_t|�}t|d�}t|d�|_t|d�}t|d�|_t|d�}t|d�|_dS(NRtinstancetRoletnamet
Deployment(R(RRRtvm_namet	role_nametdeployment_name(R<R(R@R)trolet
deployment((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRE~s	(RORPRE(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRH}sRcBseZd�ZRS(cCs
||_dS(N(R((R<R(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRE�s(RORPRE(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyR�sRcBs eZd�Zed��ZRS(cCst�|_tjjtj�t�}tj	||�t
|�}t|d�}|dkrbdSt|d�}|r�|dkr�t
jd|�dSttj��}tjjtj�t�}dj|||�}tj	||�tjjtj�t�}	tjjtj�t�}
tjjtj�t�}|j||	|
|�g}t}
t}i}i}d}g}t|��q}xg|j�D]Y}|j|�tjd|�r�t}q�tjd|�r�t}
q�tjd	|�r9tj|d
|�}|j |�}|||<g}|d7}t}q�tjd|�r�tj|d
|�}|j!|�}|j"|�}|||<dj|�}|jidd6|d6�tj#|tjjtj�|��g}|d7}t}
q�q�WWdQXx�|D]z}||}|rn||}dj|�}tj#|tjjtj�|��t
j$dj|��qt
jd�qWx=|D]5}||kr�d}t
j$|j||��q�q�Wx:|D]2}t%�}t&d||�|jj'j|�q�WdS(NtDatatFormattPkcs7BlobWithPfxContentss6The Format is not Pkcs7BlobWithPfxContents. Format is s�MIME-Version:1.0
Content-Disposition: attachment; filename="{0}"
Content-Type: application/x-pkcs7-mime; name="{1}"
Content-Transfer-Encoding: base64

{2}is[-]+BEGIN.*KEY[-]+s[-]+BEGIN.*CERTIFICATE[-]+s[-]+END.*KEY[-]+tprvis[-]+END.*CERTIFICATE[-]+tcrts{0}.crtRSt
thumbprints{0}.prvs)Found private key matching thumbprint {0}s2Found NO matching cert/thumbprint for private key!s<Certificate with thumbprint {0} has no matching private key.R6((Rt	cert_listtostpathtjointconftget_lib_dirtCERTS_FILE_NAMER
t
write_fileRRR1RFRMRtget_openssl_cmdt
P7M_FILE_NAMER"tTRANSPORT_PRV_FILE_NAMEtTRANSPORT_CERT_FILE_NAMEt
PEM_FILE_NAMEtdecrypt_p7mtFalsetopent	readlinestappendtretmatchtTrueRt_write_to_tmp_filetget_pubkey_from_prvtget_pubkey_from_crttget_thumbprint_from_crttrenameRGRRtcertificates(R<R(t
local_fileR@tdatatcertificateFormatt	cryptutiltp7m_filetp7mttrans_prv_filettrans_cert_filetpem_filetbuft	begin_crtt	begin_prvtprvstthumbprintstindextv1_cert_listtpemtlinettmp_filetpubR_R^tpubkeyR]Rtv1_certtcert((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRE�s�
		

	
	%



%
!
	cCsDtjjtj�dj||��}tj|dj|��|S(Ns{0}.{1}t(RaRbRcRdReR"R
Rg(R�tsuffixR�t	file_name((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRu�s'(RORPREtstaticmethodRu(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyR�s	cRJcBs&eZdZd�Zed��ZRS(s;
    Object containing information about user accounts
    cCs�||_d|_d|_t�|_|jdksKt|j�dkrOdSt|j�}t|d�|_t|d�|_t	|d�}t
|d�}x0|D](}tj|�}|jj
j|�q�WdS(NitVersionRtUserstUser(R(R1tversionR)R	t	user_listtlenRRRR
RJt_parse_usertusersRq(R<R(R@tuser_collectionR�tusertremote_access_user((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRE
s			$
cCsCt|d�}t|d�}t|d�}t|||�}|S(NtNametPasswordt
Expiration(RR(R�RStencrypted_passwordt
expirationR�((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyR�s
(RORPt__doc__RER�R�(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyRJ�s	(/RaRrR*tazurelinuxagent.common.conftcommonRdtazurelinuxagent.common.loggerRFt#azurelinuxagent.common.AgentGlobalsRt#azurelinuxagent.common.datacontractRt azurelinuxagent.common.exceptionRRtazurelinuxagent.common.futureRt=azurelinuxagent.common.protocol.extensions_goal_state_factoryRt'azurelinuxagent.common.protocol.restapiRRRR	tazurelinuxagent.common.utilsR
t&azurelinuxagent.common.utils.cryptutilRt%azurelinuxagent.common.utils.textutilRR
RRRR!RfRiRlRkRjR%tobjectRRHRRRJ(((sN/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/goal_state.pyt<module>s4"(Ok