a '¡Dghã@sœUdZddlZddlZddlmZddlmZddlmZddl m Z ddl m Z ddl mZd e ged gd œZe ed <e e¡Zeeeedd œdd„ZdS)zERuncmd: run arbitrary commands at rc.local with output to the consoleéN)Úutil)ÚCloud)ÚConfig)Ú MetaSchema)Ú ALL_DISTROS)Ú PER_INSTANCEZ cc_runcmdÚruncmd)ÚidZdistrosZ frequencyZactivate_by_schema_keysÚmeta)ÚnameÚcfgÚcloudÚargsÚreturnc CsŽd|vrt d|¡dStj | d¡d¡}|d}zt |¡}t ||d¡Wn8t yˆ}z t |ƒd  ||¡ƒ‚WYd}~n d}~00dS)Nrz:Skipping module named %s, no 'runcmd' key in configurationZscriptsiÀz"Failed to shellify {} into file {}) ÚLOGÚdebugÚosÚpathÚjoinZ get_ipathrZshellifyZ write_fileÚ ExceptionÚtypeÚformat)r r r rZout_fnÚcmdZcontentÚe©rú>/usr/lib/python3.9/site-packages/cloudinit/config/cc_runcmd.pyÚhandle%sÿ r)Ú__doc__ZloggingrZ cloudinitrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarZcloudinit.distrosrZcloudinit.settingsrr Ú__annotations__Z getLoggerÚ__name__rÚstrÚlistrrrrrÚ s      ü