o
    wÚ7e|  ã                
   @   s¾   U d Z ddlZddlZddl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g g dœZe
ed< eeƒZ e e¡ZdZdededededdf
dd„ZdS )zScripts 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.
Úcc_scripts_userzScripts UserzRun user scripts)ÚidÚnameÚtitleÚdescriptionÚdistrosÚ	frequencyÚexamplesÚactivate_by_schema_keysÚmetaÚscriptsr   ÚcfgÚcloudÚargsÚreturnc              	   C   sD   t j | ¡ t¡}zt |¡ W d S  ty!   t 	d| t|¡ ‚ w )Nz"Failed to run module %s (%s in %s))
ÚosÚpathÚjoinÚget_ipath_curÚSCRIPT_SUBDIRr   ÚrunpartsÚ	ExceptionÚLOGÚwarning)r   r   r   r   Úrunparts_path© r"   úB/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.pyÚhandle/   s   üùr$   )Ú__doc__Úloggingr   Ú	cloudinitr   Úcloudinit.cloudr   Úcloudinit.configr   Úcloudinit.config.schemar   r   Úcloudinit.distrosr   Úcloudinit.settingsr   ÚMODULE_DESCRIPTIONr   Ú__annotations__Ú	getLoggerÚ__name__r   r   ÚstrÚlistr$   r"   r"   r"   r#   Ú<module>   s.   
ø
"