/usr/lib/python3.6/site-packages/cloudinit/__pycache__
NameSizeModeActions
apport.cpython-36.opt-1.pyc60600644editdlrm
apport.cpython-36.pyc61050644editdlrm
atomic_helper.cpython-36.opt-1.pyc21020644editdlrm
atomic_helper.cpython-36.pyc21020644editdlrm
cloud.cpython-36.opt-1.pyc31550644editdlrm
cloud.cpython-36.pyc31550644editdlrm
dmi.cpython-36.opt-1.pyc54460644editdlrm
dmi.cpython-36.pyc54460644editdlrm
event.cpython-36.opt-1.pyc20160644editdlrm
event.cpython-36.pyc20160644editdlrm
features.cpython-36.opt-1.pyc15080644editdlrm
features.cpython-36.pyc15080644editdlrm
gpg.cpython-36.opt-1.pyc38520644editdlrm
gpg.cpython-36.pyc38520644editdlrm
helpers.cpython-36.opt-1.pyc136270644editdlrm
helpers.cpython-36.pyc136270644editdlrm
importer.cpython-36.opt-1.pyc17220644editdlrm
importer.cpython-36.pyc17220644editdlrm
log.cpython-36.opt-1.pyc47180644editdlrm
log.cpython-36.pyc47180644editdlrm
netinfo.cpython-36.opt-1.pyc129720644editdlrm
netinfo.cpython-36.pyc129720644editdlrm
persistence.cpython-36.opt-1.pyc28830644editdlrm
persistence.cpython-36.pyc28830644editdlrm
registry.cpython-36.opt-1.pyc14180644editdlrm
registry.cpython-36.pyc14180644editdlrm
safeyaml.cpython-36.opt-1.pyc81880644editdlrm
safeyaml.cpython-36.pyc81880644editdlrm
settings.cpython-36.opt-1.pyc11680644editdlrm
settings.cpython-36.pyc11680644editdlrm
signal_handler.cpython-36.opt-1.pyc16180644editdlrm
signal_handler.cpython-36.pyc16180644editdlrm
simpletable.cpython-36.opt-1.pyc25900644editdlrm
simpletable.cpython-36.pyc25900644editdlrm
ssh_util.cpython-36.opt-1.pyc157280644editdlrm
ssh_util.cpython-36.pyc157280644editdlrm
stages.cpython-36.opt-1.pyc257490644editdlrm
stages.cpython-36.pyc257490644editdlrm
subp.cpython-36.opt-1.pyc102070644editdlrm
subp.cpython-36.pyc102070644editdlrm
templater.cpython-36.opt-1.pyc46600644editdlrm
templater.cpython-36.pyc46600644editdlrm
temp_utils.cpython-36.opt-1.pyc28800644editdlrm
temp_utils.cpython-36.pyc28800644editdlrm
type_utils.cpython-36.opt-1.pyc4370644editdlrm
type_utils.cpython-36.pyc4370644editdlrm
url_helper.cpython-36.opt-1.pyc215390644editdlrm
url_helper.cpython-36.pyc215390644editdlrm
user_data.cpython-36.opt-1.pyc84460644editdlrm
user_data.cpython-36.pyc84460644editdlrm
util.cpython-36.opt-1.pyc754120644editdlrm
util.cpython-36.pyc754120644editdlrm
version.cpython-36.opt-1.pyc4300644editdlrm
version.cpython-36.pyc4300644editdlrm
warnings.cpython-36.opt-1.pyc33290644editdlrm
warnings.cpython-36.pyc33290644editdlrm
__init__.cpython-36.opt-1.pyc1130644editdlrm
__init__.cpython-36.pyc1130644editdlrm
Edit: /usr/lib/python3.6/site-packages/cloudinit/__pycache__/templater.cpython-36.pyc (4660B)
3 \me @s UddlZddlZddlZddlZddlmZddlmZddlm Z ddl m Z e y$ddl mZddl mZdZeZ Wn eefk rd ZeZ YnXejeZejd ejZejd Zd ZGd dde ZddZddZ ddZ!dddZ"ddZ#dddZ$dS)N)Any) type_utils)util) write_file)DebugUndefined)TemplateTFz##\s*template:(.*)z)\$\{([A-Za-z0-9_.]+)\}|\$([A-Za-z0-9_.]+)zCI_MISSING_JINJA_VAR/c@s eZdZdZddZddZdS)UndefinedJinjaVariablez>Class used to represent any undefined jinja template variable.cCsdt|jfS)Nz%s%s)MISSING_JINJA_PREFIX_undefined_name)selfr /usr/lib/python3.6/templater.py__str__2szUndefinedJinjaVariable.__str__cCs(t|jtd}tdj|j|ddS)NzhUndefined jinja variable: "{this}-{other}". Jinja tried subtraction. Perhaps you meant "{this}_{other}"?)thisother)strreplacer TypeErrorformatr )r rr r r __sub__5szUndefinedJinjaVariable.__sub__N)__name__ __module__ __qualname____doc__rrr r r r r/srcsfdd}tj||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|jd}|dkr|jd}|dkr,tdtj|jd}}xBt|dkr|j}t|tsxt d|t j ||f||}qBW|j}t|tst d||t j |ft ||S)Nz,Match encountered but no valid group present.zRCan not traverse into non-dictionary '%s' of type %s while looking for subkey '%s'z.replacer) BASIC_MATCHERsub)contentr,r-r )r,r basic_render?s r1cCsdd}|jdd kr(|jdd\}}n|}d}tj|}|sHdt|fS|jdjj}|d krntd||dkrt rt j d dt|fS|dkrt rd||fSdt|fSdS) NcSs0|jdrdnd}t|tddgdjf||S)N rTz jinja2.ext.do)Z undefinedZ trim_blocks extensions)endswith JTemplaterZrender)r0r,addr r r jinja_renderfs z%detect_template..jinja_renderr2rrbasicjinjaz.Unknown template rendering type '%s' requestedzcJinja not available as the selected renderer for desired template, reverting to the basic renderer.)r9r8) findr" TYPE_MATCHERr(r1rlowerstrip ValueErrorJINJA_AVAILABLELOGZwarning)textr7ZidentrestZ type_match template_typer r r detect_templatees(      rEcCs4|si}ttj|\}}}tjd|||||S)Nz+Rendering content of '%s' using renderer %s)rErZ load_filerAdebug)fnr,rDrendererr0r r r render_from_files rIcCst||}tj|||ddS)N)mode)rIrr)rGZoutfnr,rKcontentsr r r render_to_files rMcCs |si}t|\}}}|||S)z Render string)rE)r0r,Z_template_typerHr r r render_stringsrNc Cst|d}|j}WdQRX||d}t||jd}|r\tj|dd}|s\td||dkrrtjj |nt ||dd dS) Nr)variantprefixr2T)defaultz.Cannot render template file %s - invalid yaml.-w)Zomode) openreadrNrstriprZ load_yamlrsysstdoutwriter) rPtemplateoutputZis_yamlrQZfhrLZ tpl_paramsoutr r r render_templates   r^)rJ)N)%r ZloggingrerXZtypingrZ cloudinitrr'rZcloudinit.atomic_helperrZ JUndefinedZjinja2rZ_DebugUndefinedrr5r@ ImportErrorAttributeErrorobjectZ getLoggerrrAcompileIr<r.r rr1rErIrMrNr^r r r r s8         &)