
    f<              
           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j&                  e      ZdZdededededdf
dZy)z.Scripts Per Instance: Run per instance scripts    N)subp)Cloud)Config)
MetaSchemaget_meta_doc)ALL_DISTROS)PER_INSTANCEa[  Any scripts in the ``scripts/per-instance`` directory on the datasource will
be run when a new instance is first booted. Scripts will be run in alphabetical
order. This module does not accept any config keys.

Some cloud platforms change instance-id if a significant change was made to
the system. As a result per-instance scripts will run again.
cc_scripts_per_instancezScripts Per InstancezRun per instance scripts)idnametitledescriptiondistros	frequencyexamplesactivate_by_schema_keysmetazper-instancer   cfgcloudargsreturnc                     t         j                  j                  |j                         dt              }	 t        j                  |       y # t        $ r t        j                  d| t        |        w xY 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_paths        J/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_per_instance.pyhandler%   .   s^     GGLL!2I}MM	m$ 0		
 	s   A 'A2)__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$   <module>r6      s    5  	  ! # < ) +  $"'%}!	j 	 t
g! 6 % t  r5   