HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_ubuntu_drivers.cpython-36.pyc
3

\�me<�@sUdZddlZddlZddlmZddlmZddlmZyddl	Z	dZ
Wnek
rfdZ	dZ
YnXddlm
Z
mZmZmZdd	lmZdd
lmZmZddlmZeje�ZdgZd
dded�eed�gedgd�Zeee�ZdZdZdZed�dd�Z e!eee"dd�dd�Z#dS)z<Ubuntu Drivers: Interact with third party drivers in Ubuntu.�N)�dedent)�Cloud)�DistroTF)�subp�
temp_utils�
type_utils�util)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCEZubuntuZcc_ubuntu_driverszUbuntu Driversz,Interact with third party drivers in Ubuntu.zo        This module interacts with the 'ubuntu-drivers' command to install
        third party driver packages.zN        drivers:
          nvidia:
            license-accepted: true
        �drivers)�id�name�title�description�distrosZexamplesZ	frequencyZactivate_by_schema_keyszDubuntu-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 tdtj|�|f��d}tjtj||��}|sLtj	d||�dSt
jd�sjtj	d�|dg�d}tj|d�}|r�|d	j|�7}tj	d
|||r�|nd�t
j|j�dd
�}tjj|d�}zpy2tj|t�tjd��}	|	jt|�WdQRXWn8tk
�r0}
ztjtdt|
���WYdd}
~
XnXWdtjj|��rNtj|�Xyt
j
ddd|g�WnVt
jk
�r�}z6t|j k�r�tj!d�nd|j"k�r�tj!d��WYdd}~XnXdS)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: %sZinstallz--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�joinZ
write_file�NVIDIA_DEBCONF_CONTENT�debconfZDebconfCommunicatorZcommandr�	ExceptionZlogexc�str�isdirZdel_dirZProcessExecutionError� OLD_UBUNTU_DRIVERS_STDERR_NEEDLE�stderr�warning�stdout)�cfgZpkg_install_funcrZcfgpathZnv_accZ
driver_argZversion_cfgZtdirZdebconf_fileZdc�e�exc�r+�'/usr/lib/python3.6/cc_ubuntu_drivers.py�install_driversNsV



r-)rr(�cloud�args�returncCsFd|krtjd|�dSts,tjd|�dSt|d|jj|j�dS)Nr
z4Skipping module named %s, no 'drivers' key in configz<Skipping module named %s, 'python3-debconf' is not installed)rr�HAS_DEBCONFr&r-rZinstall_packages)rr(r.r/r+r+r,�handle�sr2)$�__doc__Zloggingr�textwraprZcloudinit.cloudrZcloudinit.distrosrr r1�ImportErrorZ	cloudinitrrrrZcloudinit.configr	Zcloudinit.config.schemar
rZcloudinit.settingsrZ	getLogger�__name__rr�metar$rrr-r"�listr2r+r+r+r,�<module>sB

@