
    x[hh              
           U d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ d	eged
gdZe
ed<    ej"                  e      Zdededededdf
dZy)zERuncmd: run arbitrary commands at rc.local with output to the console    N)util)Cloud)Config)
MetaSchema)ALL_DISTROS)PER_INSTANCE	cc_runcmdruncmd)iddistros	frequencyactivate_by_schema_keysmetanamecfgcloudargsreturnc                 `   d|vrt         j                  d|        y t        j                  j	                  |j                  d      d      }|d   }	 t        j                  |      }t        j                  ||d       y # t        $ r&} t        |      dj                  ||            d }~ww xY w)Nr
   z:Skipping module named %s, no 'runcmd' key in configurationscriptsi  z"Failed to shellify {} into file {})LOGdebugospathjoin	get_ipathr   shellify
write_file	Exceptiontypeformat)r   r   r   r   out_fncmdcontentes           </usr/lib/python3/dist-packages/cloudinit/config/cc_runcmd.pyhandler'   %   s    s		H$	
 	WW\\%//)4h?F
h-CP--$/ Pd1g:AA#vNOOPs   ,A> >	B-!B((B-)__doc__loggingr   	cloudinitr   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.distrosr   cloudinit.settingsr   r   __annotations__	getLogger__name__r   strlistr'        r&   <module>r7      s    L  	  ! # . ) + } (z	j  g!P P6 P% Pt P Pr6   