File: //lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_scripts_user.cpython-36.pyc
3
\�mee � @ s� U d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ d Zd
ddee
geg g d
�Ze
ee�Z eje�ZdZeeeedd�dd�ZdS )zScripts User: Run user scripts� N)�subp)�Cloud)�Config)�
MetaSchema�get_meta_doc)�ALL_DISTROS)�PER_INSTANCEa� This module runs all user scripts. User scripts are not specified in the
``scripts`` directory in the datasource, but rather are present in the
``scripts`` dir in the instance configuration. Any cloud-config parts with a
``#!`` will be treated as a script and run. Scripts specified as cloud-config
parts will be run in the order they are specified in the configuration.
This module does not accept any config keys.
Zcc_scripts_userzScripts UserzRun user scripts)�id�name�title�descriptionZdistrosZ frequencyZexamplesZactivate_by_schema_keys�scripts)r
�cfg�cloud�args�returnc C sL t jj|j� t�}ytj|� W n& tk
rF tj d| t|� � Y nX d S )Nz"Failed to run module %s (%s in %s))
�os�path�joinZ
get_ipath_cur�
SCRIPT_SUBDIRr Zrunparts� Exception�LOGZwarning)r
r r r Z
runparts_path� r �%/usr/lib/python3.6/cc_scripts_user.py�handle/ s r )�__doc__Zloggingr Z cloudinitr Zcloudinit.cloudr Zcloudinit.configr Zcloudinit.config.schemar r Zcloudinit.distrosr Zcloudinit.settingsr ZMODULE_DESCRIPTION�metaZ getLogger�__name__r r �str�listr r r r r �<module> s*