
    쑛h              
           U d Z ddlZddlmZmZmZ ddlmZ ddlm	Z	 ddl
mZ ddlmZ  ej                  e      ZeZdd	ged
gdZeed<   dede	dededdf
dZy)z:Bootcmd: run arbitrary commands early in the boot process.    N)subp
temp_utilsutil)Cloud)Config)
MetaSchema)
PER_ALWAYS
cc_bootcmdallbootcmd)iddistros	frequencyactivate_by_schema_keysmetanamecfgcloudargsreturnc           	      v   d|vrt         j                  d|        y t        j                  d      5 }	 t	        j
                  |d         }|j                  t	        j                  |             |j                          	 |j                         }|rdt        |      ini }t        j                  d|j                  g|d	       	 d d d        y # t        $ r*}t	        j                  t         dt        |              d }~ww xY w# t        $ r t	        j                  t         d
|         w xY w# 1 sw Y   y xY w)Nr   z;Skipping module named %s, no 'bootcmd' key in configurationz.sh)suffixzFailed to shellify bootcmd: %sINSTANCE_IDz/bin/shF)
update_envcapturezFailed to run bootcmd module %s)LOGdebugr   ExtendedTemporaryFiler   shellifywriteencode_textflush	Exceptionlogexcstrget_instance_idr   r   )	r   r   r   r   tmpfcontenteiidenvs	            =/usr/lib/python3/dist-packages/cloudinit/config/cc_bootcmd.pyhandler-   !   s   		I4	
 			)	)	7 4	mmC	N3GJJt''01JJL
	'')C/2=#c(+CIIy$)),eL 
  	KK=s1vF	  	KK>E	 s<   D/ACAD	D%C>>DD/&D,,D//D8)__doc__logging	cloudinitr   r   r   cloudinit.cloudr   cloudinit.configr   cloudinit.config.schemar   cloudinit.settingsr	   	getLogger__name__r   r   r   __annotations__r%   listr-        r,   <module>r;      s    A  , , ! # . )g!	 w ){	j  6 % t  r:   