HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_phone_home.cpython-38.pyc
U

Ӈg��@s�UdZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZd	d
ddd
dgZde
gedgd�Zeed<e�e�Zee	eedd�dd�ZdS)zPhone Home: Post data to url�N)�	templater�
url_helper�util)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�PER_INSTANCE�pub_key_rsa�
pub_key_ecdsa�pub_key_ed25519�instance_id�hostname�fqdnZ
cc_phone_home�
phone_home)�idZdistrosZ	frequencyZactivate_by_schema_keys�meta)�name�cfg�cloud�args�returnc	Cst|�dkrt�|d�}n d|kr4t�d|�dS|d}d|krTt�d|�dS|d}|�dd�}|�d�}zt|�}Wn*tt	fk
r�d	}t�
td
|�YnX|dkr�t}|��|�
�j|j
dd�jd
�}dddd�}	|	��D]@\}
}zt�|�||
<Wq�tk
�r(t�
td|�Yq�Xq�i}|D]2}
|
|k�rP||
||
<nd||
<t�d|
��q4i}|��D]*\}
}|dk�r�d||
<nt|�||
<�qtd|di}t�||�}z$tj|||ddt�|j�d�Wn&tk
�rt�
td||�YnXdS)Nrrz=Skipping module named %s, no 'phone_home' configuration found�urlzFSkipping module named %s, no 'url' found in 'phone_home' configurationZpost�all�tries�
z?Configuration entry 'tries' is not an integer, using %s insteadT)r)r
rrz/etc/ssh/ssh_host_rsa_key.pubz/etc/ssh/ssh_host_ecdsa_key.pubz!/etc/ssh/ssh_host_ed25519_key.pub)r
rrz1%s: failed to open, can not phone home that data!z=Requested key %s from 'post' configuration list not availablezN/AZINSTANCE_IDr
��)�dataZretriesZsec_betweenZssl_detailsz0Failed to post phone home data to %s in %s tries)�lenrZ	read_conf�LOG�debugZwarning�get�int�
ValueError�	TypeErrorZlogexc�
POST_LIST_ALLZget_instance_idZget_hostnamer�itemsZload_text_file�	Exception�strrZ
render_stringrZread_file_or_urlZfetch_ssl_details�paths)rrrrZph_cfgrZ	post_listrZall_keysZpubkeys�n�pathZsubmit_keys�kZreal_submit_keys�vZ
url_params�r/�@/usr/lib/python3/dist-packages/cloudinit/config/cc_phone_home.py�handle1s���
�
���
�

�
�
�r1)�__doc__ZloggingZ	cloudinitrrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.settingsr	r&r�__annotations__Z	getLogger�__name__r r)�listr1r/r/r/r0�<module>	s*�
�