a '¡Dg ã@s®UdZddlZddlmZmZmZddlmZddlm Z ddl m Z ddl m Z ddlmZdd lmZeZd e gegd œZe ed <e e¡Zd Zee eeddœdd„ZdS)z@Final Message: Output final message when cloud-init has finishedéN)Ú templaterÚutilÚversion)ÚCloud)ÚConfig)Ú MetaSchema)Ú ALL_DISTROS)Úlog_util)Ú PER_ALWAYSZcc_final_message)ÚidZdistrosÚ frequencyZactivate_by_schema_keysÚmetazy## template: jinja Cloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}. Up {{uptime}} seconds)ÚnameÚcfgÚcloudÚargsÚreturnc Cs|d}t|ƒdkrt|dƒ}nt |dd¡}| ¡}|s<ózhandle..z%s FT)ZconsoleÚstderrÚlogz,Failed to render templated final message: %sz'Failed to render final message templatez%s - %s - v. %s )Zensure_dir_existsz%Failed to write boot finished file %sÚNoneZdatasource_listzUsed fallback datasource)ÚlenÚstrrZget_cfg_option_strÚstripÚFINAL_MESSAGE_DEFrZ time_rfc2822rZversion_stringrÚupdateÚdictÚitemsr Z multi_logrZ render_stringÚLOGZJinjaSyntaxParsingExceptionZlogexcÚ ExceptionÚpathsZ boot_finishedZ write_fileZdsnameZsys_cfgÚgetZwarning) rrrrZmsg_inrÚtsZcverZsubsÚeZ boot_fin_fnÚcontentsrrrÚhandle&sL üü  ÿ r/)Ú__doc__ZloggingZ cloudinitrrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZ cloudinit.logr Zcloudinit.settingsr r r Ú__annotations__Z getLoggerÚ__name__r(r$r"Úlistr/rrrrÚs$      ü ÿ