3 \¼me ã @s¶UdZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z ddlmZeZd Zd d d ee geggd œZe e eƒZejeƒZdZeeeeddœdd„ZdS)z&Scripts Per Once: Run one time scriptséN)Úsubp)ÚCloud)ÚConfig)Ú MetaSchemaÚ get_meta_doc)Ú ALL_DISTROS)ÚPER_ONCEa4Any 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. Zcc_scripts_per_oncezScripts Per OncezRun one time scripts)ÚidÚnameÚtitleÚ descriptionZdistrosÚ frequencyZexamplesZactivate_by_schema_keyszper-once)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 rrrZ runparts_path©rú)/usr/lib/python3.6/cc_scripts_per_once.pyÚhandle-sr)Ú__doc__ZloggingrZ cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.distrosrZcloudinit.settingsrr ZMODULE_DESCRIPTIONÚmetaZ getLoggerÚ__name__rrÚstrÚlistrrrrrÚs,