3 \¼meeã @s²UdZddlZddlZddlmZddlmZddlmZddl m Z m Z ddl m Z ddlmZd Zd d d ee geggd œZe e eƒZejeƒZdZeeeeddœdd„ZdS)zScripts User: Run user scriptséN)Úsubp)ÚCloud)ÚConfig)Ú MetaSchemaÚ get_meta_doc)Ú ALL_DISTROS)Ú PER_INSTANCEa This module runs all user scripts. User scripts are not specified in the ``scripts`` directory in the datasource, but rather are present in the ``scripts`` dir in the instance configuration. Any cloud-config parts with a ``#!`` will be treated as a script and run. Scripts specified as cloud-config parts will be run in the order they are specified in the configuration. This module does not accept any config keys. Zcc_scripts_userz Scripts UserzRun user scripts)ÚidÚnameÚtitleÚ descriptionZdistrosZ frequencyZexamplesZactivate_by_schema_keysÚscripts)r ÚcfgÚcloudÚargsÚreturnc CsLtjj|jƒtƒ}ytj|ƒWn&tk rFtj d|t|ƒ‚YnXdS)Nz"Failed to run module %s (%s in %s)) ÚosÚpathÚjoinZ get_ipath_curÚ SCRIPT_SUBDIRrZrunpartsÚ ExceptionÚLOGZwarning)r rrrZ runparts_path©rú%/usr/lib/python3.6/cc_scripts_user.pyÚhandle/sr)Ú__doc__ZloggingrZ cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrZcloudinit.distrosrZcloudinit.settingsrZMODULE_DESCRIPTIONÚmetaZ getLoggerÚ__name__rrÚstrÚlistrrrrrÚs*