3
\¼me ã @ s¶ U d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m
Z
mZ ddlm
Z
ddlmZ eZd Zd
ddee
geg g d
œZe
eeƒZ ejeƒZdZeeeeddœdd„ZdS )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.
Zcc_scripts_per_oncezScripts Per OncezRun one time scripts)ÚidÚnameÚtitleÚdescriptionZdistrosÚ frequencyZexamplesZactivate_by_schema_keyszper-once)r
ÚcfgÚcloudÚargsÚreturnc C sN t jj|jƒ dtƒ}ytj|ƒ W n& tk
rH tj d| t|ƒ ‚ Y nX d S )NÚscriptsz"Failed to run module %s (%s in %s))
ÚosÚpathÚjoinZ get_cpathÚ
SCRIPT_SUBDIRr ZrunpartsÚ ExceptionÚLOGZwarning)r
r r r Z
runparts_path© r ú)/usr/lib/python3.6/cc_scripts_per_once.pyÚhandle- s r )Ú__doc__Zloggingr Z cloudinitr Zcloudinit.cloudr Zcloudinit.configr Zcloudinit.config.schemar r Zcloudinit.distrosr Zcloudinit.settingsr r
ZMODULE_DESCRIPTIONÚmetaZ getLoggerÚ__name__r r ÚstrÚlistr r r r r Ú