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: sonne (1011)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyo
�
d�bc@s�ddlZddljjZddljjZddlmZmZddl	m
Z
ddlmZm
Z
dZdZdZdZd	Zd
�Zd�Zd�Zd
�Zd�ZdS(i����N(t	add_eventtWALAEventOperation(tKNOWN_WIRESERVER_IP(t
AGENT_NAMEtCURRENT_VERSIONtMetadataProtocolsV2TransportPrivate.pemsV2TransportCert.pemsCertificates.p7bs169.254.169.254cCs+tjjtj�t�}tjj|�S(N(tostpathtjointconftget_lib_dirt0_LEGACY_METADATA_SERVER_TRANSPORT_CERT_FILE_NAMEtisfile(tmetadata_artifact_path((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyt#is_metadata_server_artifact_present(scCs"tjd�t�t|�dS(Ns�Clean up for MetadataServer to WireServer protocol migration: removing MetadataServer certificates and resetting firewall rules.(tloggertinfot'_cleanup_metadata_protocol_certificatest_reset_firewall_rules(tosutil((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyt!cleanup_metadata_server_artifacts,s
cCs7tj�}t|t�t|t�t|t�dS(s.
    Removes MetadataServer Certificates.
    N(R	R
t_ensure_file_removedt/_LEGACY_METADATA_SERVER_TRANSPORT_PRV_FILE_NAMERt%_LEGACY_METADATA_SERVER_P7B_FILE_NAME(t
lib_directory((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyR1s

c
Csr|jdtdtj��tj�rn|jdtdtj��}ttdt	dt
jd|dt�ndS(s�
    Removes MetadataServer firewall rule so IMDS can be used. Enables
    WireServer firewall rule based on if firewall is configured to be on.
    tdst_iptuidtversiontopt
is_successt	log_eventN(
tremove_firewallt_KNOWN_METADATASERVER_IPRtgetuidR	tenable_firewallRRRRRtFirewalltFalse(Rtsuccess((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyR:s	cCs;tjj||�}tjj|�r7tj|�ndS(s,
    Removes files if they are present.
    N(RRRRtremove(t	directoryt	file_nameR((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyRIs(Rtazurelinuxagent.common.conftcommonR	tazurelinuxagent.common.loggerRtazurelinuxagent.common.eventRRt%azurelinuxagent.common.utils.restutilRtazurelinuxagent.common.versionRRt_METADATA_PROTOCOL_NAMERRRR RRRRR(((sb/usr/lib/python2.7/site-packages/azurelinuxagent/common/protocol/metadata_server_migration_util.pyt<module>s