3
\me+
@ s U d Z ddlZddlZddlmZ ddlmZmZ ddlm Z ddl
mZ ddlm
Z
mZ ddlmZ dd lmZ d
Zddd
eegeedededgg dZe
eeZ ejeZdZeee eddddZdS )z"Scripts Vendor: Run vendor scripts N)dedent)subputil)Cloud)Config)
MetaSchemaget_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.
Zcc_scripts_vendorzScripts VendorzRun 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
)idnametitledescriptionZdistrosZ frequencyZexamplesZactivate_by_schema_keysZvendor)r cfgcloudargsreturnc C s` t jj|j dt}tj|dg }ytj||d W n& t k
rZ t
jd| t| Y nX d S )Nscriptsvendor_dataprefix)Z
exe_prefixz"Failed to run module %s (%s in %s))r r )ospathjoinZ
get_ipath_cur
SCRIPT_SUBDIRr Zget_cfg_by_pathr Zrunparts ExceptionLOGZwarning)r r r r Z
runparts_pathr r '/usr/lib/python3.6/cc_scripts_vendor.pyhandleD s r )__doc__Zloggingr textwrapr Z cloudinitr r Zcloudinit.cloudr Zcloudinit.configr Zcloudinit.config.schemar r Zcloudinit.distrosr Zcloudinit.settingsr
ZMODULE_DESCRIPTIONmetaZ getLogger__name__r r strlistr r r r r