HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/cloudinit/sources/azure/__pycache__/kvp.cpython-310.pyc
o

x[hk�@s�ddlZddlmZmZddlmZddlmZddlmZm	Z	ddl
mZmZe�
e�Zdeejfdd	�Zd
edefdd�Zd
ejdefdd�Zdefdd�ZdS)�N)�datetime�timezone)�Optional)�version)�handlers�instantiated_handler_registry)�errors�identity�returncCs tj�d�}t|tj�sdS|S)z'Get instantiated KVP telemetry handler.�	telemetryN)r�registered_items�get�
isinstancer�HyperVKvpReportingHandler)�kvp_handler�r�=/usr/lib/python3/dist-packages/cloudinit/sources/azure/kvp.py�get_kvp_handlers�r�reportcCs,t�}|durt�d�dS|�d|�dS)z/Report to host via PROVISIONING_REPORT KVP key.Nz.KVP handler not enabled, skipping host report.F�PROVISIONING_REPORTT)r�LOG�debug�	write_key)rrrrr�report_via_kvps
r�errorcCst|���S)N)r�as_encoded_report)rrrr�report_failure_to_host&src
Csxzt��}Wnty}zd|��}WYd}~nd}~wwt�ddt����dt�t	j
�����d|��g�}t|�S)Nzfailed to read vm id: zresult=successzagent=Cloud-Init/z
timestamp=zvm_id=)
r	�query_vm_id�	Exceptionr�
encode_reportr�version_stringr�nowr�utc�	isoformatr)�vm_id�id_errorrrrr�report_success_to_host*s����	r&)�loggingrr�typingr�	cloudinitr�cloudinit.reportingrr�cloudinit.sources.azurerr	�	getLogger�__name__rrr�str�boolr�ReportableErrorrr&rrrr�<module>s