+
    i                        R t ^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHtH	t	H
t
Ht Rt]! 4       P                  t]P                  ! ]4      tR	R ltR
R ltR t]R8X  d/   ]P*                  ! ]! ]]! 4       P-                  4       4      4       R# R# )z,Debug jinja template rendering of user-data.N)read_cfg_paths)JinjaLoadErrorJinjaSyntaxParsingExceptionNotJinjaErrorrender_jinja_payload_from_filerenderc                    V '       g!   \         P                  ! \        \        R7      p V P	                  R\
        RR7       V P	                  RR\
        R\         2R7       V P	                  RR	R
RRR7       V # )a  Build or extend and arg parser for jinja render utility.

@param parser: Optional existing ArgumentParser instance representing the
    subcommand which will be extended to support the args of this utility.

@returns: ArgumentParser with proper argument configuration.
)progdescription	user_dataz$Path to the user-data file to render)typehelpz-iz--instance-dataz6Optional path to instance-data.json file. Defaults to z-dz--debug
store_trueFz+Add verbose messages during template render)actiondefaultr   )argparseArgumentParserNAME__doc__add_argumentstrCLOUDINIT_RUN_DIR)parsers   &</usr/lib/python3/dist-packages/cloudinit/cmd/devel/render.py
get_parserr      s     ((dH
#$J   ,-/   :   M    c                   V'       d   TpM\        4       p\        P                  ! 4       pVP                  R4      pV^ 8X  dQ   VP                  R4      p\        P                  P                  V4      '       g   \        P                  RVV4       TpMTp\        P                  P                  V4      '       g   \        P                  RV4       ^#  \        V 4      ;_uu_ 4       pVP                  4       pRRR4        \        XT TT'       d   RMRR	7      p	T	'       g   \        P                  RT 4       ^# \$        P&                  P)                  T	4       ^ #   + '       g   i     Lk; i  \         d    \        P                  RT 4        ^# i ; i  \        \        3 d+   p
\        P                  R
\        T
4      4        Rp
?
^# Rp
?
i\          d,   p
\        P                  RT \#        T
4      4        Rp
?
^# Rp
?
ii ; i)zRender the provided user-data template file using instance-data values.

Also setup CLI log handlers to report to stderr since this is a development
utility which should be run by a human on the CLI.

@return 0 on success, 1 on failure.
instance_datainstance_data_sensitivez4Missing root-readable %s. Using redacted %s instead.z#Missing instance-data.json file: %sNzMissing user-data file: %sTF)payload
payload_fninstance_data_filedebugz5Cannot render from instance data due to exception: %sz2Failed to render templated user-data file '%s'. %sz#Unable to render user-data file: %s)r   osgetuidget_runpathpathexistsLOGwarningerroropenreadIOErrorr   r   r   reprr   r   sysstdoutwrite)user_data_pathinstance_data_pathr"   instance_data_fnpathsuidredacted_data_fnstreamr   rendered_payloades   &&&        r   render_templater;   :   s    - iik ,,_=!8$001JK77>>"233J$$
 $4 /77>>*++		79IJ.!!VI "
9%/$U	
$ 		7HJJ%&9 "! 		.? M* 		CT!W	
 & 		@F	

 sZ   E- &E7E-  F E*	%E- *E- -!FFH&GHH G??Hc                 X    \        VP                  VP                  VP                  4      # N)r;   r   r   r"   )_nameargss   &&r   handle_argsr@   v   s    4>>4+=+=tzzJJr   __main__r=   )NF)r   r   loggingr#   r/   cloudinit.cmd.develr   !cloudinit.handlers.jinja_templater   r   r   r   r   run_dirr   	getLogger__name__r(   r   r;   r@   exit
parse_args r   r   <module>rK      s   
 3   	 
 .  "$,, !@9xK zHH[z|6689: r   