Current File : //lib/python2.7/site-packages/cloudinit/config/cc_ubuntu_drivers.pyc
�
oB�]c	@s�dZddlZddlmZddlmZmZddlmZ	ddl
mZddlmZddlm
Z
dd	lmZe	je�ZeZd
gZi	dd6d
d6dd6ed�d6ed6ed�gd6ed6dd6iidd6ed6iidd6ed6dgd6iidd6dd6d6idd6dd6d 6d!6d"6d!6d#6d!6Zd$Zee�Zd%Zd&Zd'�Zd(�ZdS()s<Ubuntu Drivers: Interact with third party drivers in Ubuntu.i����N(tdedent(tget_schema_doctvalidate_cloudconfig_schema(tlog(tPER_INSTANCE(t
temp_utils(t
type_utils(tutiltubuntutcc_ubuntu_driverstidsUbuntu Driverstnames,Interact with third party drivers in Ubuntu.ttitleso        This module interacts with the 'ubuntu-drivers' command to install
        third party driver packages.tdescriptiontdistrossN        drivers:
          nvidia:
            license-accepted: true
        texamplest	frequencytobjectttypetadditionalPropertiesslicense-acceptedtrequiredtbooleans(Do you accept the NVIDIA driver license?tstringsYThe version of the driver to install (e.g. "390", "410"). Defaults to the latest version.tversiont
propertiestnvidiatdriverssDubuntu-drivers: error: argument <command>: invalid choice: 'install's�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.
s�#!/bin/sh
# Allow cloud-init to trigger EULA acceptance via registering a debconf
# template to set linux/nvidia/latelink true
. /usr/share/debconf/confmodule
db_x_loadtemplatefile "$1" cloud-init
cCsJt|t�s1tdtj|�|f��nd}tjtj||��}|sotj	d||�dStj
d�s�tj	d�|dg�nd}tj|d�}|r�|d	j|�7}ntj	d
|||r�|nd�tj
dt�}tjj|d
�}tjj|d�}z|yFtj|t�tj|tjt�dd�tj||g�Wn/tk
r�}	tjtdt|	���nXWdtjj|�r�tj|�nXytjddd|g�WnWtjk
rE}
t|
jkr tjd�nd|
j kr?tjd�n�nXdS(Ns.'drivers' config expected dict, found '%s': %ssnvidia/license-accepteds$Not installing NVIDIA drivers. %s=%ssubuntu-driverssI'ubuntu-drivers' command not available.  Installing ubuntu-drivers-commonsubuntu-drivers-commonRsnvidia/versions:{}s<Installing and activating NVIDIA drivers (%s=%s, version=%s)tlatestt	needs_exesnvidia.templatesnvidia-debconf.shtmodei�s.Failed to register NVIDIA debconf template: %stinstalls--gpgpus[the available version of ubuntu-drivers is too old to perform requested driver installations"No drivers found for installation.s0ubuntu-drivers found no drivers for installation(!t
isinstancetdictt	TypeErrorRtobj_nameRttranslate_booltget_cfg_by_pathtLOGtdebugtwhichtformatRtmkdtemptTruetostpathtjoint
write_filetNVIDIA_DEBCONF_CONTENTtencode_textt%NVIDIA_DRIVER_LATELINK_DEBCONF_SCRIPTtsubpt	Exceptiontlogexctstrtisdirtdel_dirtProcessExecutionErrort OLD_UBUNTU_DRIVERS_STDERR_NEEDLEtstderrtwarningtstdout(tcfgtpkg_install_functcfgpathtnv_acct
driver_argtversion_cfgttdirtdebconf_filetdebconf_scripttetexc((sF/usr/lib/python2.7/site-packages/cloudinit/config/cc_ubuntu_drivers.pytinstall_drivers`sV
	cCsHd|kr |jd|�dSt|t�t|d|jj�dS(NRs4Skipping module named %s, no 'drivers' key in config(R&RtschemaRHtdistrotinstall_packages(RR=tcloudRt_args((sF/usr/lib/python2.7/site-packages/cloudinit/config/cc_ubuntu_drivers.pythandle�s

(t__doc__R+ttextwrapRtcloudinit.config.schemaRRt	cloudinitRtloggingtcloudinit.settingsRRRRt	getLoggert__name__R%RRtFalseRIR9R/R1RHRN(((sF/usr/lib/python2.7/site-packages/cloudinit/config/cc_ubuntu_drivers.pyt<module>sX	


"	: