a ì)gÓã@s¨ddlmZmZmZeZddlZddlZddlZddl Z ddl Z ddl Z ddl m Z mZddlmZddlmZddlmZddlmZdd lmZdd lmZmZmZmZdd lm Z m!Z!m"Z"dd l#m$Z$dd l%m&Z&ddl'm(Z(ddl)m*Z*ddl+m,Z,m-Z-m.Z.m/Z/ddl0m1Z1m2Z2ddl3m4Z4m5Z5ddl6m7Z7ddl8m9Z9m:Z:ddl;mZ>ddl?m@Z@WneAyˆdZ>dZ@Yn0ddlBZCe7ƒZDedddgƒZEdd„ZFdd„ZGdzdd „ZHd!d"„ZIGd#d$„d$eJƒZKGd%d&„d&eJƒZLGd'd(„d(ƒZMGd)d*„d*eMƒZNd{d,d-„ZOd.d/„ZPd0d1„ZQd2d3„ZRd4d5„ZSePƒZTeSƒeMd6d7ejUd8ƒZVeMd9d:ejWd;dd?ejYd@ƒZZeMdAdBej[dCƒZ\eMdDdEej]dFdGdHidIdJZ^eMdKdLdMdMƒZ_eMdNdOej`dPƒZaeMdNdQejbdRƒZceMdNdQejbdRƒZdeMdSdTejedUdVd=ZfeNdWdXejgdYeƒZheNdZd[ejid\eƒZjeMd]d^ejkd_d`d=ZleMdadbejmdcddd=ZneMdedfejodgƒZpeMdhdiejqdjdkd=ZreMdldmejsdndod=ZteMdpdqejudrƒZveMdsdtejwdudvd=ZxeMdwdxejydyƒZzdS)|é)Úabsolute_importÚdivisionÚprint_functionN)Ú defaultdictÚ namedtuple)Ú format_excé)ÚAnsibleJinja2Filter)ÚAnsibleJinja2Test)Ú __version__)Ú constants)Ú AnsibleErrorÚAnsiblePluginCircularRedirectÚAnsiblePluginRemovedErrorÚ(AnsibleCollectionUnsupportedVersionError)Úto_bytesÚto_textÚ to_native)Ú import_module)Ú string_types)Ú from_yaml)Ú AnsibleLoader)Úget_plugin_classÚ MODULE_CACHEÚ PATH_CACHEÚPLUGIN_PATH_CACHE)ÚAnsibleCollectionConfigÚAnsibleCollectionRef)Ú_AnsibleCollectionFinderÚ_get_collection_metadata)ÚDisplay)Ú add_fragmentsÚfind_plugin_docfile)Ú _is_unsafe)Ú SpecifierSet)ÚVersionÚget_with_context_resultÚobjectÚplugin_load_contextcCsdd„tƒ ¡DƒS)NcSs"g|]\}}t|tƒr||f‘qS©)Ú isinstanceÚ PluginLoader)Ú.0ÚnameÚobjr)r)ú:/usr/lib/python3.9/site-packages/ansible/plugins/loader.pyÚ 8óz*get_all_plugin_loaders..)ÚglobalsÚitemsr)r)r)r/Úget_all_plugin_loaders7sr4cCs|tj t|dd¡}tj |¡rftƒD]<\}}|jr&tj |t|jƒ¡}tj |¡r&| t |ƒ¡q&nt   dt |ƒ¡dS)z3 add any existing plugin dirs in the path provided Úsurrogate_or_strict©ÚerrorszFIgnoring invalid path provided to plugin path: '%s' is not a directoryN) ÚosÚpathÚ expanduserrÚisdirr4ÚsubdirÚjoinÚ add_directoryrÚdisplayÚwarning)r9Úb_pathr-r.Ú plugin_pathr)r)r/Úadd_all_plugin_dirs;s  rCcCsª|s|d}|rtt|tƒr|tj |¡}zt |¡}WntyFd}Yn0|dur|t ¡D]}||j vrX|j }q|qXnt dƒ‚t |¡}|s–t d|ƒ‚|r¦t |d|ƒ|S)NÚshz;Either a shell type or a shell executable must be provided z.Could not find the shell plugin required (%s).Ú executable) r*rr8r9ÚbasenameÚ shell_loaderÚgetÚ ExceptionÚallZCOMPATIBLE_SHELLSZ SHELL_FAMILYr Úsetattr)Z shell_typerEZshell_filenameÚshellr)r)r/Úget_shell_pluginHs*         rMcCs0ttjtd|ƒ}|D]}|j|ddqdS)Nz %s_loaderT)Ú with_subdir)ÚgetattrÚsysÚmodulesÚ__name__r>)Z which_loaderÚpathsÚloaderr9r)r)r/Úadd_dirs_to_loaderisrUc@seZdZdd„ZdS)ÚPluginPathContextcCs||_||_dS©N)r9Úinternal)Úselfr9rXr)r)r/Ú__init__qszPluginPathContext.__init__N)rRÚ __module__Ú __qualname__rZr)r)r)r/rVpsrVc@s@eZdZdd„Zedd„ƒZdd„Zdd„Zd d „Zd d „Z d S)ÚPluginLoadContextcCsjd|_g|_g|_g|_g|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ g|_ d|_d|_d|_dS©NF)Ú original_nameÚ redirect_listÚ error_listÚimport_error_listÚ load_attemptsÚpending_redirectÚ exit_reasonÚplugin_resolved_pathÚplugin_resolved_nameÚplugin_resolved_collectionÚ deprecatedÚ removal_dateÚremoval_versionÚdeprecation_warningsÚresolvedÚ_resolved_fqcnÚ action_plugin©rYr)r)r/rZws"zPluginLoadContext.__init__cCsf|js dS|js`|jd}t |¡r<| d¡r<| d¡d}|jrZt |¡sZ|jd|}||_|jS)Néÿÿÿÿúansible.legacy.Ú.)rmrnr`rÚ is_valid_fqcrÚ startswithÚsplitrh)rYZ final_pluginr)r)r/Ú resolved_fqcnŠs zPluginLoadContext.resolved_fqcncCsŽ|s|S| dd¡pd}| dd¡}| dd¡}|durdd„Zd?dd„Zdd„Zd@dd „ZdAd!d"„ZdBd#d$„ZdCd&d'„ZdDd(d)„Zd%dddeƒfd*d+„ZdEd,d-„ZdFd.d/„ZeZd0d1„ZdGd2d3„Zd4d5„Zd6d7„ZdHd8d9„Z d:d;„Z!dS)Ir+zç PluginLoader loads plugins from the configured plugin directories. It searches for plugins by iterating through the combined list of play basedirs, configured paths, and the python path. The first match is used. NcCs¶|dur in|}||_||_||_||_||_|rDt|tƒsD|g}n|sLg}||_|tvrbit|<|t vrrdt |<|t vr†t t ƒt |<g|_ t||_t ||_t ||_tƒ|_dSrW)Ú class_nameÚ base_classÚpackager<Úaliasesr*ÚlistÚconfigrrrrÚdictÚ _extra_dirsÚ _module_cacheÚ_pathsÚ_plugin_path_cacheÚsetÚ_searched_paths)rYr‡r‰rŒr<rŠÚrequired_base_classr)r)r/rZÐs,    zPluginLoader.__init__cCs t |j¡SrW)rÚ legacy_plugin_dir_to_plugin_typer<rpr)r)r/ÚtypeószPluginLoader.typecCs d |j¡S)NzPluginLoader(type={0}))r~r–rpr)r)r/Ú__repr__÷szPluginLoader.__repr__cCs`tjrd|_nNit|j<dt|j<ttƒt|j<t|j|_ t|j|_t|j|_ t ƒ|_ dSrW) ÚCZOLD_PLUGIN_CACHE_CLEARINGrrr‡rrrrrr‘r’r“rpr)r)r/Ú _clear_cachesús     zPluginLoader._clear_cachescCsŽ| d¡}| d¡}| d¡}| d¡}| d¡}| d¡}| d¡t|<| d¡t|<| ||||||¡| d g¡|_| d tƒ¡|_d S) z Deserializer. r‡r‰rŒr<rŠrˆrrrŽr“N)rHrrrZrŽr’r“)rYÚdatar‡r‰rŒr<rŠrˆr)r)r/Ú __setstate__ s      zPluginLoader.__setstate__c Cs8t|j|j|j|j|j|j|j|jt |jt |jd S)z Serializer. ) r‡rˆr‰rŒr<rŠrŽr“rr) rr‡rˆr‰rŒr<rŠrŽr“rrrpr)r)r/Ú __getstate__sözPluginLoader.__getstate__cCs,g}|D]}||vr| |¡qtj |¡S)z; Returns a string suitable for printing of the search path )rr8Úpathsepr=)rYrSÚretÚir)r)r/Ú format_paths/s  zPluginLoader.format_pathscCs| |jdd¡S)NF©Úsubdirs)r Ú _get_pathsrpr)r)r/Ú print_paths9szPluginLoader.print_pathscCsRg}| |¡tj|ddD]0\}}}d|vr|D]}| tj ||¡¡q2q|S)NT)Ú followlinksz __init__.py)rr8Úwalkr9r=)rYÚdirÚresultsÚrootr¢ÚfilesÚxr)r)r/Ú_all_directories<s zPluginLoader._all_directoriesTcCsv|js gSt|dƒs^t|jƒ}|j d¡dd…}|D]}t||ƒ}q6ttj |j ¡dd|_ |rn|  |j ¡S|j gS)z# Gets the path of a Python package Ú package_pathrsrNr5r6) r‰ÚhasattrÚ __import__rvrOrr8r9ÚdirnameÚ__file__r­r¬)rYr¢ÚmÚpartsZ parent_modr)r)r/Ú_get_package_pathsEs    zPluginLoader._get_package_pathscCsþ|jdur|jSdd„|jDƒ}|jdurÈ|jD]–}tj tj |¡¡}|r¢t d|¡t d|¡}|D]4}t|dd}tj  |¡rl||vrl|  t |dƒ¡qlt|dd}||vr0|  t |dƒ¡q0|  d d„|j |d Dƒ¡|jd d „d ||_|S)zE Return a list of PluginPathContext objects to search for plugins in NcSsg|]}t|dƒ‘qS)F©rV©r,Úpr)r)r/r0]r1z8PluginLoader._get_paths_with_context..z%s/*z%s/*/*r5r6FcSsg|]}t|dƒ‘qS)Trµr¶r)r)r/r0qr1r¡cSs |j d¡S)Nz/windows)r9Úendswith)r·r)r)r/Úƒr1z6PluginLoader._get_paths_with_context..©Úkey)rrŽrŒr8r9Úabspathr:Úglobrr;rrVÚextendr´Úsort)rYr¢ržr9ÚcontentsÚcr)r)r/Ú_get_paths_with_contextTs&     z$PluginLoader._get_paths_with_contextcCs|j|d}dd„|DƒS)z1 Return a list of paths to search for plugins in r¡cSsg|] }|j‘qSr))r9)r,Úpath_with_contextr)r)r/r0r1z+PluginLoader._get_paths..)rÂ)rYr¢Zpaths_with_contextr)r)r/r£‰s zPluginLoader._get_pathscCs˜|jr”t|jƒ}|tjvr”tj ||¡s”tt|ddƒ|d ¡}|r”t ||t |dkdd|vr”t |dt ƒr”tj  |||d¡t d||f¡dS) zf Reads plugin docs to find configuration setting definitions, to push to config manager for later use Z DOCUMENTATIONry)Ú file_nameÚmodule)Úfragment_loaderZ is_moduleÚoptionsz%Loaded config def from plugin (%s/%s)N)r‡rr˜ZCONFIGURABLE_PLUGINSrŒZhas_configuration_definitionrrOZget_single_datar!rÆr*rZ+initialize_plugin_configuration_definitionsr?Údebug)rYr-rÅr9Ú type_nameZdstringr)r)r/Ú_load_config_defss zPluginLoader._load_config_defsFcCsXtj |¡}|durT|r(tj ||j¡}||jvrT|j |¡| ¡t  d|¡dS)z1 Adds an additional directory to the search path NzAdded %s to loader search path) r8r9Úrealpathr=r<rŽrr™r?rÈ)rYZ directoryrNr)r)r/r>¦s   zPluginLoader.add_directorycCs¶t|jƒ}|sdSzt|jd |¡ƒWnty<Yn0t|ddƒ}|sRdS|jrld |j|jg¡}n|j}| di¡ |i¡ ||d¡}|s²| di¡ |i¡ |d¡}|S)Nz .plugins.{0}Z_collection_metarsÚplugin_routing) rZ n_python_collection_package_namer~Ú ImportErrorrOr¢r=ÚresourcerH)rYÚacrÚ plugin_typeÚ extensionZcollection_pkgÚcollection_metaZsubdir_qualified_resourceÚentryr)r)r/Ú_query_collection_routing_meta´s"    z+PluginLoader._query_collection_routing_metac CsÌd|_t |j¡}t ||¡}|j|||d}d}|rb| dd¡} |sX| || |j¡| dd¡} | rÚ|  d¡} |  d¡} |  d¡pˆd } d   || r˜d nd | ¡} t j | | | d |jd }| |_ | |_ d |_||_t||d‚| dd¡}|rLt |¡std|j›d|›d|›dƒ‚t  d  |||¡¡||jvrB|j |¡| |¡S|jdkrb| d¡}t|jdd}d  |j|¡}|rŒ||7}tj |j¡}|sÖzt|jƒ}Wn&tyÔ| d  |j¡¡YS0tj  !|j"¡}tj  #||¡}tj  $|¡r"| %|t&|ƒ|jd  ||j¡|¡S|r@| d  t&|ƒ|j¡¡Sdd„t' (tj  #||¡d¡Dƒ}|s|| d   ||j¡¡St)|ƒ}t*|ƒd!kr¦t  +d"d# #|¡¡| %|t&|d$ƒ|jd%  ||j¡|¡S)&z˜Search builtin paths to find a plugin. No external paths are searched, meaning plugins inside roles inside collections will be ignored. F)rÑNr€Ú tombstonerjrkrxryz{0} has been removed.{1}{2}rzT)Úmsgr|r{Úremovedr}©r(r„ú Collection ú contains invalid redirect for ú: ú6. Redirects must use fully qualified collection names.z"redirecting (type: {0}) {1} to {2}rQroÚstrictr6ú{0}.{1}zPython package {0} not foundz found exact match for {0} in {1}zno match for {0} in {1}cSs(g|] }tj |¡r| tj¡s|‘qSr))r8r9Úisfiler¸r˜ÚMODULE_IGNORE_EXTS©r,Úfr)r)r/r00sþz0PluginLoader._find_fq_plugin..z.*z+failed fuzzy extension match for {0} in {1}rzDFound several possible candidates for the plugin but using first: %sú,rz*found fuzzy extension match for {0} in {1}),rmrr•r<Z from_fqcrrÔrHrÚ collectionr~r?Úget_deprecation_messagerjrkrerrtr Zvvr`rr„r–rrÎÚn_python_package_namerPrQrrÍr…r8r9r°r±r=Úexistsrƒrr½ZiglobÚsortedÚlenrÈ)rYÚfq_namerÑr(Úignore_deprecatedrÐrÏZrouting_metadataror€rÕrjrkrxZ removed_msgr„Z n_resourceÚ full_nameÚpkgZpkg_pathZn_resource_pathZ found_filesr)r)r/Ú_find_fq_pluginÓs„      þ   ÿ     ÿÿþzPluginLoader._find_fq_pluginrycCs(| |||||¡}|jr$|jr$|jSdS)z Find a plugin named name N)Úfind_plugin_with_contextrmrf)rYr-Úmod_typerëÚ check_aliasesÚcollection_listÚresultr)r)r/Ú find_plugin@s zPluginLoader.find_plugincCs|tƒ}||_|j||||||d}|jr^|j|jvrHtd |j|j¡ƒ‚|j}d|_|}q q^q |jrxt  d ||j¡¡|S)zg Find a plugin named name, returning contextual info about the load, recursively resolving redirection rØz.plugin redirect loop resolving {0} (path: {1})Nz;errors were encountered during the plugin load for {0}: {1}) r]r_Ú_resolve_plugin_steprdr`rr~rar?r@)rYr-rðrërñròr(rór)r)r/rïHs  z%PluginLoader.find_plugin_with_contextc sì|s tdƒ‚|j ˆ¡d|_ˆt|jvr‚Yqœtyn} z|j | ¡WYd} ~ qœd} ~ 0ty¢} z|j t| ƒ¡WYd} ~ qœd} ~ 00qœ|jrÊtjd  ˆd |j¡¡dd ˆ¡|_|S|  ˆ||||¡S)NzA PluginLoadContext is requiredFz#{0} matched a defined plugin filterz.pyryZAnsiblerscsg|]}d |ˆ¡‘qS)rÞ)r~)r,rÁ©r-r)r/r0r1z5PluginLoader._resolve_plugin_step..zansible.legacyrr)r(rëz)plugin lookup for {0} failed; errors: {1}z; )rÖzno matches found for {0})Ú ValueErrorr`rrmÚ_PLUGIN_FILTERSr‰r~rer‡rrtrurcÚ_find_plugin_legacyÚ removeprefixrîrdrrrrÍrbrIrarr?rÈr=) rYr-rðrërñròr(ÚsuffixZ candidatesZcandidate_nameZieÚexr)rör/rõfsR       ÿ ÿ  ( z!PluginLoader._resolve_plugin_stepc sxd|_|rˆj ||¡}ˆj|}zF||}|j|_||_|jrDdnd|_|jrXd|n||_ d|_|WSt yzYn0‡fdd„ˆ  ¡DƒD]}|j}t |ƒ‰t  d|¡|j |¡|j} z‡fd d„t ˆ¡Dƒ} Wn8ty} zt  d t| ƒ¡WYd } ~ n d } ~ 00d d„| DƒD]‰tj ˆ¡} t‡fd d„tjDƒƒrZq*tj | ¡} | d}z | d}Wnty’d}Yn0tˆdd‰|ˆjdvrÄtˆ| ƒˆjd|<| ˆjdvrètˆ| ƒˆjd| <|ˆj|vr tˆ| ƒˆj||<| ˆj|vr*tˆ| ƒˆj|| <q*ˆj |¡zN||}|j|_||_|jrddnd|_|jrzd|n||_ d|_|WSt y¢Yq’0q’| d¡s6d|}||vr6||}|sötj  |j¡söt  !d| "d¡¡|j|_||_|jrdnd|_|jr&d|n||_ d|_|Sd #|¡}d|vrht$ %|¡rhˆj&||||dS| 'd #|¡¡S)zSearch library and various *_plugins paths in order to find the file. This was behavior prior to the existence of collections. Fúansible.builtinryúansible.builtin.Tc3s0|](}|jˆjvrtj t|jƒ¡r|VqdSrW)r9r“r8r;rr¶rpr)r/Ú Ìr1z3PluginLoader._find_plugin_legacy..z trying %sc3s|]}tj ˆ|¡VqdSrW)r8r9r=rá)rAr)r/rÿÓr1z Error accessing plugin paths: %sNcss,|]$}tj |¡r| d¡st|ƒVqdS)s __init__.pyN)r8r9rßr¸rrár)r)r/rÿ×r1c3s|]}ˆ |¡VqdSrW)r¸)r,r«)Ú full_pathr)r/rÿÝr1rrr5r6Ú_z%s is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.zansible.builtin.{0}rs)rêrÑr(rëz.{0} is not eligible for last-chance resolution)(rmrŠrHr‘r9rfrgrXrhrnÚKeyErrorrÂrr?rÈrcrr8ÚlistdirÚOSErrorr@rrFÚanyr˜ràÚsplitextÚ IndexErrorrVr“ÚaddruÚislinkriÚlstripr~rrtrîr…)rYr-r(rërñrûZ pull_cacherÃr9rXZ full_pathsÚerìZ splitnameÚ base_namerÑZ alias_nameZcandidate_fqcrr))rArrYr/rù¯s   (         ÿ z PluginLoader._find_plugin_legacyc Cs^z|j||dduWStyX}z,t|tƒr0‚t d t|ƒ¡¡WYd}~n d}~00dS)z& Checks if a plugin named name exists ©ròNzhas_plugin error: {0})rôrIr*r r?rÈr~r)rYr-ròrür)r)r/Ú has_plugins  zPluginLoader.has_pluginc CsÆ| d¡r|}nd |j|g¡}|tjvr4tj|St ¡vt dt¡t j   t |ƒt |ƒ¡}t j   |¡}|tj|<z|j |¡Wnty¢tj|=‚Yn0Wdƒn1s¸0Y|S)Núansible_collections.rsÚignore)rur=r‰rPrQÚwarningsÚcatch_warningsÚ simplefilterÚRuntimeWarningÚ importlibÚutilÚspec_from_file_locationrÚmodule_from_specrTÚ exec_modulerI)rYr-r9rìÚspecrÅr)r)r/Ú_load_module_source's         &z PluginLoader._load_module_sourcecCs„t|d|ƒt|d|ƒt|d|p$gƒg}|r:| |¡|rR| |ddd…¡|sdtd|›ƒ‚t|d|ƒt|d|dƒdS) NÚ_original_pathZ _load_nameZ_redirected_namesrqzMissing FQCN for plugin source Zansible_aliasesÚ ansible_namer)rKrr¾r )rYr.r-r9Úredirected_namesrmÚnamesr)r)r/Ú_update_objectFs    zPluginLoader._update_objectcOs|j|g|¢Ri|¤ŽjSrW)Úget_with_contextr')rYr-ÚargsÚkwargsr)r)r/rHYszPluginLoader.getc Ost|ƒr| ¡}d}| dd¡}| dd¡}||jvr@|j|}|j||d}|jrZ|jsdtd|ƒS|j}d|vr‚d  |j |f¡}|j }|j} |j p–g} | |j vr¸| || ¡|j | <d}| ||j | | ¡t|j | |jƒ} |jr>t|j|jgd} zt| |jƒ} Wnty&td|ƒYS0t| | ƒs>td|ƒS|j|j||j| ||d |szrÔrîrôrïr]rõrùrÚ __contains__rr rHr!r,rJr)r)r)r/r+Ès@ #    5    m  ÿ I k  H r+csleZdZdZd‡fdd„ Z‡fdd„Zdd d „Zed d „ƒZd d„Z ‡fdd„Z dd„Z ‡fdd„Z ‡Z S)Ú Jinja2Loadera  PluginLoader optimized for Jinja2 plugins The filter and test plugins are Jinja2 plugins encapsulated inside of our plugin format. We need to do a few things differently in the base class because of file == plugin assumptions and dedupe logic. Ncs,tt|ƒj||||||d||_i|_dS)N©rŠr”)ÚsuperrArZÚ_plugin_wrapper_typeÚ_cached_non_collection_wrappers)rYr‡r‰rŒr<Zplugin_wrapper_typerŠr”©Ú __class__r)r/rZ<szJinja2Loader.__init__cstt|ƒ ¡i|_dSrW)rCrAr™rErprFr)r/r™AszJinja2Loader._clear_cachesryFcCs tdƒ‚dS)Nz,find_plugin is not supported on Jinja2Loader)ÚNotImplementedError)rYr-rðrërñròr)r)r/rôEszJinja2Loader.find_plugincCst|jƒdS)NÚs)rr‡rpr)r)r/Úmethod_map_nameHszJinja2Loader.method_map_namec Csng}d d|d|j|g¡}z6||jvr8| ||¡|j|<|j|}t||jƒ}Wn:tyŠ}z"td||t|ƒfƒ‚WYd}~n d}~00|ƒ} | durªtd||fƒ‚zt| |j ƒ} | ƒ  ¡} WnDty}z*t   d|jt |ƒ|f¡|WYd}~Sd}~00| D]Z\} } d || f¡}d || f¡}| | ¡}||vrJq|j||||d| |¡q|S)NrsZansible_collectionsÚpluginszFailed to load %s for %s: %szCould not find %s.%sz9Ignoring %s plugins in '%s' as it seems to be invalid: %rr9)r=r–rrrOr‡rIrrrJr3r?r@rrDr r)rYrärBr-rKrìrÅr.r Ú plugin_implÚ method_mapÚ plugin_mapÚ func_nameÚfuncrêZfullÚpluginr)r)r/Úget_contained_pluginsLs6  ,    z"Jinja2Loader.get_contained_pluginsc$ sÐ| dd¡| dd¡tƒ}| d¡}|j|i|¤Ž|j |¡}r„d|_||_|j|_ |j   d¡rldnd|_ |j |_ t||ƒSd}t|ƒ\}}tƒ} || vr°td |d ƒ‚|  |¡t ||j¡} | sÚtd  |¡ƒ‚zt| jƒ} Wn:ty"} z td  |t| ƒ¡ƒ‚WYd} ~ n d} ~ 00|  d i¡ |ji¡ |i¡} |  d¡}|r˜| d¡}| d¡}| d¡}|s„d |j|¡}tj|||| jd|  d¡}|rø| d¡}| d¡}| d¡}|sÚd |j|¡}tj|||| jdd}t|ƒ‚|  dd¡}|rxt  |¡s>td| j›d| j›d| j!›d|›d ƒ‚t|| jd\}}t "d |j| j| j!|¡¡|}qšqxqšzt#| j$ƒ}Wn2t%y¸} ztt| ƒƒ‚WYd} ~ n d} ~ 00| j}| j&rÖd || j&¡}z@t'j(|j)|dd D]$\}}}|rqîz:t*t+|ƒj,|g|¢Ri|¤Ž}t-|j.|j/ƒ}|ƒ 0¡}WnRt1y} z8t 2d!|j›d"|›d#| ›¡WYd} ~ qîWYd} ~ n d} ~ 00|D]z\}}d 3||f¡} d$| j›d%|j›d| j&›d|›}!||| fvr–| 4|¡}|r–|j5}|j6||!|j.j| d&qîq–qîWn¬tyP}"ztt|"ƒd |"d'‚WYd}"~"n~d}"~"0ttfyh‚Yn^t1yÄ}#zDt 2d( t|#ƒ¡¡t "d) t7ƒ¡¡tt|#ƒd |#d'‚WYd}#~#n d}#~#00t||ƒS)*Nr$FròrrTrþrýryz*recursive collection redirect found for %rrzinvalid plugin name: {0}zInvalid plugin FQCN ({0}): {1}rÌr€rxrjrkz{0} "{1}" is deprecated)r|r{r}rÕz{0} "{1}" has been removed)r|r{r}r×r„rÙrÚrsrÛrÜ)räz&redirecting (type: {0}) {1}.{2} to {3}rÞ)Úprefixz Skipping z plugins in z$'; an error occurred while loading: rz .plugins.r9)Zorig_excz>An unexpected error occurred during Jinja2 plugin loading: {0}z2Unexpected error during Jinja2 plugin loading: {0})8r)r]rúÚ_ensure_non_collection_wrappersrErHrmrgrrfrrurhrnr&Úget_fqcr_and_namer’r rrZtry_parse_fqcrr–rr~rrär÷rr?rirårrtrÎZvvvrrærÍr¢ÚpkgutilÚ iter_modulesÚ__path__rCrAr!rOr'rJr3rIr@r=rDr(r r)$rYr-r"r#ÚcontextZ known_pluginrQr»Zleaf_keyÚseenrÏÚtsr Z routing_entryZdeprecation_entryrxrjrkZtombstone_entryZexc_msgr„Znext_keyríZ parent_prefixZdummyZ module_nameÚispkgrLrMrNrOrPrêZsrc_nameZaprerürFr)r/r!rs¶      *         ÿ  "ÿ" $ " &(zJinja2Loader.get_with_contextcos‚| dd¡| dd¡}| dd¡}|r4|r4tdƒ‚|j|i|¤Ž|rddd„|j ¡DƒEdHndd„|j ¡DƒEdHdS) Nr2r3Fr$r4css|] }|jVqdSrW)r©r,Úwr)r)r/rÿr1z#Jinja2Loader.all..css|] }|VqdSrWr)r]r)r)r/rÿr1)r)r rTrEÚvalues)rYr"r#r3r$r)r)r/rJùs   zJinja2Loader.allc sÈ|jr dStt|ƒj|i|¤ŽD] }|j d¡}t||jƒ}z |ƒ}WnLty”}z4t   d|j t |j ƒ|f¡WYd}~q WYd}~n d}~00| ¡D] }d|vrÆt  |›d|j ›d¡qž|t|jvrät  d|¡qž| ||¡} |} |j d¡dkr"d |j d¡dd…¡nd} | | ¡s@| ›d|›} |j| ||j | d || h} |rr|  d|›¡| D]H} |j | ¡}r²t  d | ›d |j ›d |j ›d ¡qv| |j| <qvqžq dS)Nrþz9Skipping %s plugins in '%s' as it seems to be invalid: %rrsz skipped in z.; Jinja plugin short names may not contain "."z)%s skipped due to a defined plugin filteréryr9z Jinja plugin z from z" skipped; shadowed by plugin from ú))rErCrArJrrurOrJrIr?Úvvvvr–rrÚkeysrÈrør‰rDÚcountr=rvr rrH)rYr"r#Zp_mapÚ is_builtinZ plugins_listrKr Z plugin_nameÚwrapperr>räZ target_namesZ target_nameZexisting_pluginrFr)r/rTsB   "0 ÿ z,Jinja2Loader._ensure_non_collection_wrappers)NN)ryFFN)rRr[r\r?rZr™rôr†rJrRr!rJrTÚ __classcell__r)r)rFr/rA4s   & rArýcCs4d|vr|}|d|}n| d¡d}|}||fS)Nrsrq)rv)rÎrär-Zfqcrr)r)r/rU8s rUc Csªttƒ}d}tjdurd}n tj}d}tj |¡rpt|dƒn}zt|  ¡ƒ}WnLt yœ}z4t   d  |t|ƒ¡¡|WYd}~WdƒSd}~00Wdƒn1s²0Yz |d}Wn&tyît   d  |¡¡|YS0t|ƒ}| ¡}|dkr^zt| d |d ¡ƒ|d <Wn(tyNt   d   |¡¡|YS0|d |d <nt   d  |¡¡n|r†t   d  |¡¡d|d vr¦td  t|ƒ¡ƒ‚|S)NFz/etc/ansible/plugin_filters.ymlTÚrbz;The plugin filter file, {0} was not parsable. Skipping: {1}Zfilter_versionz2The plugin filter file, {0} was invalid. Skipping.z1.0zmodule_rejectlist)Zmodule_blacklistúansible.moduleszWUnable to parse the plugin filter file {0} as module_blacklist is not a list. Skipping.úansible.plugins.actionz^The plugin filter file, {0} was a version not recognized by this version of Ansible. Skipping.z5The plugin filter file, {0} does not exist. Skipping.ÚstatzŸThe stat module was specified in the module blacklist file, {0}, but Ansible will not function without the stat module. Please remove stat from the blacklist.)rÚ frozensetr˜ZPLUGIN_FILTERS_CFGr8r9rçÚopenrÚreadrIr?r@r~rrÚstriprHr.r r)ÚfiltersZuser_setZ filter_cfgrâZ filter_datar r|r)r)r/Ú_load_plugin_filterCsZ  ÿF  ÿ  þ ÿÿþrqc Cs¾t td ||¡ƒ¡t|ƒ}zRt| dd¡tƒsntj   d¡}d |t¡}|dkr^t  |¡n|dkrnt |ƒ‚WnHt y„‚Yn6ty¸}zt  d ||¡¡WYd}~n d}~00dS) NzLoading collection {0} from {1}Zrequires_ansibleryZ'COLLECTIONS_ON_ANSIBLE_VERSION_MISMATCHz3Collection {0} does not support Ansible version {1}r@ÚerrorzQError parsing collection metadata requires_ansible value from collection {0}: {1})r?rbrr~rÚ(_does_collection_support_ansible_versionrHÚansible_versionr˜rŒZget_config_valuer@rr rI)r}Zcollection_pathrÒZmismatch_behaviorÚmessagerür)r)r/Ú_on_collection_load_handler}s     rvcCs6|sdStst d¡dSt|ƒ}t|ƒj}| |¡S)NTz_packaging Python module unavailable; unable to validate collection Ansible version requirements)r$r?r@r%Z base_versionÚcontains)Zrequirement_stringrtÚssZbase_ansible_versionr)r)r/rss  rscCs<tjrt d¡dSttjtjƒ}| ¡tj t 7_ dS)Nz3AnsibleCollectionFinder has already been configured) rZcollection_finderrÚwarnrr˜ZCOLLECTIONS_PATHSZCOLLECTIONS_SCAN_SYS_PATHÚ_installZon_collection_loadrv)Úfinderr)r)r/Ú_configure_collection_loader s  r|ZModuleDocFragmentzansible.plugins.doc_fragmentsZ doc_fragmentsZ ActionModulerjZaction_pluginsZ ActionBase)r”Z CacheModuler6Z cache_pluginsZCallbackModulezansible.plugins.callbackZcallback_pluginsZ Connectionzansible.plugins.connectionZconnection_pluginsZparamikoZ paramiko_sshZConnectionBaserBZ ShellModulezansible.plugins.shellZ shell_pluginsryriZlibraryzansible.module_utilsZ module_utilsZ LookupModulezansible.plugins.lookupZlookup_pluginsZ LookupBaseZ FilterModulezansible.plugins.filterZfilter_pluginsZ TestModulezansible.plugins.testZ test_pluginsZStrategyModulezansible.plugins.strategyZstrategy_pluginsZ StrategyBaseZTerminalModulezansible.plugins.terminalZterminal_pluginsZ TerminalBaseZ VarsModulezansible.plugins.varsZ vars_pluginsZCliconfzansible.plugins.cliconfZcliconf_pluginsZ CliconfBaseZNetconfzansible.plugins.netconfZnetconf_pluginsZ NetconfBaseZInventoryModulezansible.plugins.inventoryZinventory_pluginsZHttpApizansible.plugins.httpapiZhttpapi_pluginsZ HttpApiBaseZ BecomeModulezansible.plugins.becomeZbecome_plugins)NN)rý){Z __future__rrrr–Z __metaclass__r½r8Zos.pathrVrPrÚ collectionsrrÚ tracebackrr7r r8r Zansibler rtr r˜Zansible.errorsr rrrZansible.module_utils._textrrrZ%ansible.module_utils.compat.importlibrZansible.module_utils.sixrZansible.parsing.utils.yamlrZansible.parsing.yaml.loaderrZansible.pluginsrrrrZansible.utils.collection_loaderrrZ2ansible.utils.collection_loader._collection_finderrrZansible.utils.displayr Zansible.utils.plugin_docsr!r"Zansible.utils.unsafe_proxyr#Zpackaging.specifiersr$Zpackaging.versionr%rÍÚimportlib.utilrr?r&r4rCrMrUr'rVr]r+rArUrqrvrsr|røZDOC_FRAGMENT_PLUGIN_PATHrÆZDEFAULT_ACTION_PLUGIN_PATHZ action_loaderZDEFAULT_CACHE_PLUGIN_PATHZ cache_loaderZDEFAULT_CALLBACK_PLUGIN_PATHZcallback_loaderZDEFAULT_CONNECTION_PLUGIN_PATHZconnection_loaderrGZDEFAULT_MODULE_PATHZ module_loaderZDEFAULT_MODULE_UTILS_PATHZmodule_utils_loaderZps_module_utils_loaderZDEFAULT_LOOKUP_PLUGIN_PATHZ lookup_loaderZDEFAULT_FILTER_PLUGIN_PATHZ filter_loaderZDEFAULT_TEST_PLUGIN_PATHZ test_loaderZDEFAULT_STRATEGY_PLUGIN_PATHZstrategy_loaderZDEFAULT_TERMINAL_PLUGIN_PATHZterminal_loaderZDEFAULT_VARS_PLUGIN_PATHZ vars_loaderZDEFAULT_CLICONF_PLUGIN_PATHZcliconf_loaderZDEFAULT_NETCONF_PLUGIN_PATHZnetconf_loaderZDEFAULT_INVENTORY_PLUGIN_PATHZinventory_loaderZDEFAULT_HTTPAPI_PLUGIN_PATHZhttpapi_loaderZBECOME_PLUGIN_PATHZ become_loaderr)r)r)r/Úsx              !Rr :üûüüú üüü üûûûûûüûûüûü