File: //usr/lib/python3/dist-packages/landscape/lib/__pycache__/vm_info.cpython-310.pyc
o
y)�]� � @ sX d Z ddlZddlmZmZ dZddd�Zdd d
�Zdd� Zd
d� Z dd� Z
dd� ZdS )zG
Network introspection utilities using ioctl and the /proc filesystem.
� N)�read_binary_file�read_text_file)�
sys_vendor�chassis_vendor�bios_vendor�product_name�/c C sh t | �rdS t| �rdS tj�| d�}tD ]}tj�||�}tj�|�s%qt|�}|r/| S qt| �S )a
Return a bytestring with the virtualization type if it's known, an empty
bytestring otherwise.
It loops through some possible configurations and return a bytestring with
the name of the technology being used or None if there's no match
s openvzs xenzsys/class/dmi/id) �
_is_vm_openvz�
_is_vm_xen�os�path�join� DMI_FILES�exists�_get_vm_by_vendor�_get_vm_legacy)� root_path�
dmi_info_path�
dmi_info_file�dmi_vendor_path�vendor� r �7/usr/lib/python3/dist-packages/landscape/lib/vm_info.py�get_vm_info s �r �/runc C s8 dD ]}t j�| |�}t j�|�rt|��� S qdS )zu
Return a string with the type of container the client is running in, if
any, an empty string otherwise.
)�container_typezsystemd/container� )r r r
r r �strip)�run_path�filenamer r r r �get_container_info'