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 e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 Per Once: Run one time scriptsé    N)Úsubp)ÚCloud)ÚConfig)Ú
MetaSchemaÚget_meta_doc)ÚALL_DISTROS)ÚPER_ONCEa4  Any scripts in the ``scripts/per-once`` directory on the datasource will be run
only once. Changes to the instance will not force a re-run. The only way to
re-run these scripts is to run the clean subcommand and reboot. Scripts will
be run in alphabetical order. This module does not accept any config keys.
Úcc_scripts_per_oncezScripts Per OncezRun one time scripts)ÚidÚnameÚtitleÚdescriptionÚdistrosÚ	frequencyÚexamplesÚactivate_by_schema_keysÚmetazper-oncer   ÚcfgÚcloudÚargsÚreturnc              	   C   sF   t j | ¡ dt¡}zt |¡ W d S  ty"   t 	d| t|¡ ‚ w )NÚscriptsz"Failed to run module %s (%s in %s))
ÚosÚpathÚjoinÚ	get_cpathÚSCRIPT_SUBDIRr   ÚrunpartsÚ	ExceptionÚLOGÚwarning)r   r   r   r   Úrunparts_path© r"   úF/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_per_once.pyÚhandle-   s   üùr$   )Ú__doc__Úloggingr   Ú	cloudinitr   Úcloudinit.cloudr   Úcloudinit.configr   Úcloudinit.config.schemar   r   Úcloudinit.distrosr   Úcloudinit.settingsr   r   ÚMODULE_DESCRIPTIONr   Ú__annotations__Ú	getLoggerÚ__name__r   r   ÚstrÚlistr$   r"   r"   r"   r#   Ú<module>   s0   ø
"