/usr/lib/python3/dist-packages/cloudinit/__pycache__
NameSizeModeActions
apport.cpython-310.pyc73170644editdlrm
atomic_helper.cpython-310.pyc28780644editdlrm
cloud.cpython-310.pyc31990644editdlrm
dmi.cpython-310.pyc63100644editdlrm
event.cpython-310.pyc20760644editdlrm
features.cpython-310.pyc16680644editdlrm
gpg.cpython-310.pyc69120644editdlrm
helpers.cpython-310.pyc136850644editdlrm
importer.cpython-310.pyc17760644editdlrm
lifecycle.cpython-310.pyc83840644editdlrm
netinfo.cpython-310.pyc140660644editdlrm
performance.cpython-310.pyc36670644editdlrm
persistence.cpython-310.pyc29310644editdlrm
registry.cpython-310.pyc14820644editdlrm
safeyaml.cpython-310.pyc79310644editdlrm
settings.cpython-310.pyc11850644editdlrm
signal_handler.cpython-310.pyc26890644editdlrm
simpletable.cpython-310.pyc26880644editdlrm
socket.cpython-310.pyc47440644editdlrm
ssh_util.cpython-310.pyc158150644editdlrm
stages.cpython-310.pyc275610644editdlrm
subp.cpython-310.pyc99720644editdlrm
templater.cpython-310.pyc63740644editdlrm
temp_utils.cpython-310.pyc28370644editdlrm
type_utils.cpython-310.pyc4710644editdlrm
url_helper.cpython-310.pyc291510644editdlrm
user_data.cpython-310.pyc85150644editdlrm
util.cpython-310.pyc708780644editdlrm
version.cpython-310.pyc4660644editdlrm
warnings.cpython-310.pyc33760644editdlrm
__init__.cpython-310.pyc1450644editdlrm
Edit: /usr/lib/python3/dist-packages/cloudinit/__pycache__/templater.cpython-310.pyc (6374B)
o th @s&UddlZddlZddlZddlZddlmZddlmZddlm Z ddlm Z ddlm Z ddl mZeed<zdd lmZdd lmZd ZeZWneefyZd ZeZYnweeZd ZGdddeZGdddeZe dddZ ddZ!ddZ"d ddZ#ddZ$d!ddZ%dS)"N)Any)TemplateSyntaxError) performance) type_utils)util) write_file JUndefined)DebugUndefined)TemplateTFzCI_MISSING_JINJA_VAR/c sTeZdZdeddffdd ZddZe dd ed ed edefd d ZdZ Z S)JinjaSyntaxParsingExceptionerrorreturnNcs*t|jpd|j|j|j|j|_dS)Nzunknown syntax error)super__init__messagelinenonamefilenamesource)selfr  __class__5/usr/lib/python3/dist-packages/cloudinit/templater.pyr/s z$JinjaSyntaxParsingException.__init__cCs(|j|j|j|j|jddS);Avoid jinja2.TemplateSyntaxError multi-line __str__ format. syntax_error line_number line_content)format_error_messagerrr splitlinesstriprrrr__str__;s z#JinjaSyntaxParsingException.__str__rrrcCs$|rd|nd}tjj|||dS)rz: r%r)r message_templateformatrrrrr Cs z0JinjaSyntaxParsingException.format_error_messagezfUnable to parse Jinja template due to syntax error: {syntax_error} on line {line_number}{line_content})r%) __name__ __module__ __qualname__rrr$ staticmethodstrr r& __classcell__rrrrr .s(   r c@s eZdZdZddZddZdS)UndefinedJinjaVariablez>Class used to represent any undefined jinja template variable.cCsdt|jfS)Nz%s%s)MISSING_JINJA_PREFIX_undefined_namer#rrrr$\szUndefinedJinjaVariable.__str__cCs$t|td}tdj|j|d)Nr%zhUndefined jinja variable: "{this}-{other}". Jinja tried subtraction. Perhaps you meant "{this}_{other}"?)thisother)r,replacer/ TypeErrorr'r0)rr2rrr__sub___szUndefinedJinjaVariable.__sub__N)r(r)r*__doc__r$r5rrrrr.Ys r.zRendering basic templatecsfdd}td||S)zThis does simple replacement of bash variable like templates. It identifies patterns like ${a} or $a and can also identify patterns like ${a.b} or $a.b which will look for a key 'b' in the dictionary rooted by key 'a'. cs|d}|dur|d}|durtdt|d}}t|dkrE|}t|ts;t d|t ||f||}t|dks&|}t|tsZt d||t |ft ||S)Nrz,Match encountered but no valid group present.zRCan not traverse into non-dictionary '%s' of type %s while looking for subkey '%s'z.replacerz)\$\{([A-Za-z0-9_.]+)\}|\$([A-Za-z0-9_.]+))resub)contentrIrJrrHr basic_renderis rNcCsdd}|ddkr|dd\}}n|}d}td|tj}|s'dt|fS|d}|d vr:t d ||d krJt sJt d dt|fS|d krUt rUd ||fSdt|fS) Nc Ss|drdnd}z+tdt|tddgdjd i|| WdWS1s-wYWdStyM}z |jd7_t|d|d}~wt y[}z||d}~ww) N r%zRendering jinja2 templateTz jinja2.ext.do) undefined trim_blocks extensionsr7)r r) endswithrTimed JTemplater.renderrrr Exception)rMrIaddtemplate_syntax_error unknown_errorrrr jinja_renders: ( z%detect_template..jinja_renderrOr7r%z##\s*template:(.*)basic)jinjar]z.Unknown template rendering type '%s' requestedr^zcJinja not available as the selected renderer for desired template, reverting to the basic renderer.) findr=rKrDIrNr9lowerr" ValueErrorJINJA_AVAILABLELOGwarning)textr[identrest type_match template_typerrrdetect_templates.      rkcCs4|si}tt|\}}}td|||||S)Nz+Rendering content of '%s' using renderer %s)rkrload_text_filerddebug)fnrIrjrendererrMrrrrender_from_files  rpcCst||}tj|||ddS)N)mode)rprr)rnoutfnrIrrcontentsrrrrender_to_files rucCs |si}t|\}}}|||S)z Render string)rk)rMrI_template_typerorrr render_strings rwcCsrt|}||d}t||d}|r$tj|dd}|s$td||dkr0tj|dSt ||dddS) N)variantprefixrOT)defaultz.Cannot render template file %s - invalid yaml.-w)omode) rrlrwrstrip load_yamlr:sysstdoutwriter)rxtemplateoutputis_yamlryrt tpl_paramsoutrrrrender_templates  r)rq)N)&r;loggingrKrtypingrjinja2r cloudinitrrrBrcloudinit.atomic_helperr__annotations__r _DebugUndefinedr rUrcr ImportErrorAttributeErrorobject getLoggerr(rdr/r r.timedrNrkrprurwrrrrrs>          + (2