3 \¼me<ã @s²UdZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z ddlmZd Zd d d ee geggd œZe e eƒZejeƒZdZeeeeddœdd„ZdS)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. Zcc_scripts_per_instancezScripts Per InstancezRun per instance scripts)ÚidÚnameÚtitleÚ descriptionZdistrosZ frequencyZexamplesZactivate_by_schema_keysz per-instance)r ÚcfgÚcloudÚargsÚreturnc CsNtjj|jƒdtƒ}ytj|ƒWn&tk rHtj d|t|ƒ‚YnXdS)NÚscriptsz"Failed to run module %s (%s in %s)) ÚosÚpathÚjoinZ get_cpathÚ SCRIPT_SUBDIRrZrunpartsÚ ExceptionÚLOGZwarning)r r rrZ runparts_path©rú-/usr/lib/python3.6/cc_scripts_per_instance.pyÚhandle.sr)Ú__doc__ZloggingrZ cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.distrosrZcloudinit.settingsrZMODULE_DESCRIPTIONÚmetaZ getLoggerÚ__name__rrÚstrÚlistrrrrrÚs*