
    f+	                        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d<    ee      Z  ej,                  e      ZdZdedede	deddf
dZy)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.
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descriptiondistros	frequencyexamplesactivate_by_schema_keysmetavendorr   cfgcloudargsreturnc                    t         j                  j                  |j                         dt              }t        j                  |dg       }	 t        j                  ||       y # t        $ r t        j                  d| t        |        w xY w)Nscripts)vendor_dataprefix)
exe_prefixz"Failed to run module %s (%s in %s))ospathjoinget_ipath_curSCRIPT_SUBDIRr   get_cfg_by_pathr   runparts	ExceptionLOGwarning)r   r   r   r   runparts_pathr   s         D/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_vendor.pyhandler,   D   s|     GGLLy-M !!#'@"EF	m7 0		
 	s   A$ $'B)__doc__loggingr    textwrapr   	cloudinitr   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   r	   cloudinit.distrosr
   cloudinit.settingsr   MODULE_DESCRIPTIONr   __annotations__	getLogger__name__r(   r$   strlistr,        r+   <module>r>      s    )  	    ! # < ) +  !%}	
 		
 		
.  "=j B t
g!  6 % t  r=   