
Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­Â�Â­
<!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   	
