📂 FileMgr
📍
/
usr
/
lib
/
python3
/
dist-packages
/
cloudinit
/
sources
/
azure
/
__pycache__
✏️ /usr/lib/python3/dist-packages/cloudinit/sources/azure/__pycache__/identity.cpython-312.pyc
✕ Tutup
� ��i� � �� � d dl Z d dlZd dlZd dlZd dlmZ d dlmZ ej e � Z dedefd�Zdedefd�Z defd�Zdefd �Zdefd �Z G d� de j$ � Zy) � N)�Optional)�dmi�system_uuid�returnc �� � t j | � }t t j |j �� � S # t $ r t j d| � � w xY w)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: %r)�bytes)�uuid�UUID� ValueError�LOG�error�str�bytes_le)r � original_uuids �B/usr/lib/python3/dist-packages/cloudinit/sources/azure/identity.py�byte_swap_system_uuidr sT � ��� � �+�.� � �t�y�y�}�5�5�6�7�7�� � �� � �3�[�A� ��s �A � !A!c �0 � t � rt | � S | S )z!Determine VM ID from system uuid.)� is_vm_gen1r �r s r �convert_system_uuid_to_vm_idr '