
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
3
\me+	              
   @   s   U d Z ddlZddlZddlmZ ddlmZmZ ddlm	Z	 ddl
mZ ddlmZmZ ddlmZ dd	lmZ d
Zdddeegeedededgg dZeeeZ ejeZdZeee	eddddZdS )z"Scripts Vendor: Run vendor scripts    N)dedent)subputil)Cloud)Config)
MetaSchemaget_meta_doc)ALL_DISTROS)PER_INSTANCEai  On select Datasources, vendors have a channel for the consumption
of all supported user data types via a special channel called
vendor data. Any scripts in the ``scripts/vendor`` directory in the datasource
will be run when a new instance is first booted. Scripts will be run in
alphabetical order. This module allows control over the execution of
vendor data.
Zcc_scripts_vendorzScripts VendorzRun vendor scriptszg            vendor_data:
              enabled: true
              prefix: /usr/bin/ltrace
            ze            vendor_data:
              enabled: true
              prefix: [timeout, 30]
            zr            # Vendor data will not be processed
            vendor_data:
              enabled: false
            )idnametitledescriptionZdistrosZ	frequencyZexamplesZactivate_by_schema_keysZvendor)r   cfgcloudargsreturnc             C   s`   t jj|j dt}tj|dg }ytj||d W n& t	k
rZ   t
jd| t|  Y nX d S )Nscriptsvendor_dataprefix)Z
exe_prefixz"Failed to run module %s (%s in %s))r   r   )ospathjoinZget_ipath_curSCRIPT_SUBDIRr   Zget_cfg_by_pathr   Zrunparts	ExceptionLOGZwarning)r   r   r   r   Zrunparts_pathr    r   '/usr/lib/python3.6/cc_scripts_vendor.pyhandleD   s    r   )__doc__Zloggingr   textwrapr   Z	cloudinitr   r   Zcloudinit.cloudr   Zcloudinit.configr   Zcloudinit.config.schemar   r   Zcloudinit.distrosr	   Zcloudinit.settingsr
   ZMODULE_DESCRIPTIONmetaZ	getLogger__name__r   r   strlistr   r   r   r   r   <module>   s6   	
