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: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ubuntu_drivers.cpython-38.pyc
U

ӇgN�@s�UdZddlZddlZddlmZddlmZzddlZdZWne	k
rZdZdZYnXddl
mZmZm
Z
mZddlmZdd	lmZdd
lmZe�e�Zddged
gd�Zeed<dZdZdZed�dd�Zeeeedd�dd�Z dS)z<Ubuntu Drivers: Interact with third party drivers in Ubuntu.�N)�Cloud)�DistroTF)�subp�
temp_utils�
type_utils�util)�Config)�
MetaSchema)�PER_INSTANCEZcc_ubuntu_driversZubuntu�drivers)�idZdistrosZ	frequencyZactivate_by_schema_keys�metazDubuntu-drivers: error: argument <command>: invalid choice: 'install'z�Template: linux/nvidia/latelink
Type: boolean
Default: true
Description: Late-link NVIDIA kernel modules?
 Enable this to link the NVIDIA kernel modules in cloud-init and
 make them available for use.
�X_LOADTEMPLATEFILE)�distroc
Cs�t|t�s tdt�|�|f��d}t�t�||��}|sLt�	d||�dSt
�d�sjt�	d�|dg�d}t�|d�}|r�|d	�|�7}t�	d
|||r�|nd�t
j|��dd
�}tj�|d�}zpz2t�|t�t�d��}	|	�t|�W5QRXWn8tk
�r0}
zt�tdt|
���W5d}
~
XYnXW5tj�|��rNt�|�Xzt
�
ddd|g�WnVt
jk
�r�}z4t|j k�r�t�!d�nd|j"k�r�t�!d��W5d}~XYnXdS)Nz.'drivers' config expected dict, found '%s': %sznvidia/license-acceptedz$Not installing NVIDIA drivers. %s=%szubuntu-driverszI'ubuntu-drivers' command not available.  Installing ubuntu-drivers-commonzubuntu-drivers-commonZnvidiaznvidia/versionz:{}z<Installing and activating NVIDIA drivers (%s=%s, version=%s)ZlatestT)�dirZ	needs_exeznvidia.templatez
cloud-initz.Failed to register NVIDIA debconf template: %s�installz--gpgpuz[the available version of ubuntu-drivers is too old to perform requested driver installationz"No drivers found for installation.z0ubuntu-drivers found no drivers for installation)#�
isinstance�dict�	TypeErrorrZobj_namerZtranslate_boolZget_cfg_by_path�LOG�debugrZwhich�formatrZmkdtempZget_tmp_exec_path�os�path�join�isdirZdel_dirZ
write_file�NVIDIA_DEBCONF_CONTENT�debconfZDebconfCommunicatorZcommandr�	ExceptionZlogexc�strZProcessExecutionError� OLD_UBUNTU_DRIVERS_STDERR_NEEDLE�stderr�warning�stdout)�cfgZpkg_install_funcrZcfgpathZnv_accZ
driver_argZversion_cfgZtdirZdebconf_fileZdc�e�exc�r'�D/usr/lib/python3/dist-packages/cloudinit/config/cc_ubuntu_drivers.py�install_drivers9sf
��
�

���
r))�namer$�cloud�args�returncCsFd|krt�d|�dSts,t�d|�dSt|d|jj|j�dS)Nrz4Skipping module named %s, no 'drivers' key in configz<Skipping module named %s, 'python3-debconf' is not installed)rr�HAS_DEBCONFr"r)rZinstall_packages)r*r$r+r,r'r'r(�handleys��r/)!�__doc__ZloggingrZcloudinit.cloudrZcloudinit.distrosrrr.�ImportErrorZ	cloudinitrrrrZcloudinit.configrZcloudinit.config.schemar	Zcloudinit.settingsr
Z	getLogger�__name__rr
�__annotations__r rrr)r�listr/r'r'r'r(�<module>s4

��

@