o nnh=(@sddlmZddlZddlZddlZddlZddlZddlZddlm Z m Z ddl m Z ddl mZddlmmmZddlmZddlmZdd lmZdd lmZdd lmZmZm Z m!Z!dd l"m#Z#m$Z$m%Z%dd l&m'Z'ddl(m)Z)ddl*m+Z+ddl,m-Z-m.Z.m/Z/m0Z0ddl1m2Z2m3Z3ddl4m5Z5m6Z6ddl7m8Z8ddl9m:Z:ddl;mZ>ddl?m@Z@Wn eAydZ>dZ@YnwddlBZ e eCZDe8ZEe dddgZFddZGddZHd|dd ZId!d"ZJGd#d$d$eKZLGd%d&d&eKZMGd'd(d(ZNGd)d*d*eNZOd}d,d-ZPd.d/ZQd0d1ZRd2d3ZSd~d4d5ZTd~d6d7ZUeNd8d9ejVd:ZWeNd;dd?ZYeNd@dAejZdBZ[eNdCdDej\dEZ]eNdFdGej^dHdIdJidKdLZ_eNdMdNdOdOZ`eNdPdQejadRZbeNdPdSejcdTZdeNdPdSejcdTZeeNdUdVejfdWdXd?ZgeOdYdZejhd[eZieOd\d]ejjd^eZkeNd_d`ejldadbd?ZmeNdcddejndedfd?ZoeNdgdhejpdiZqeNdjdkejrdldmd?ZseNdndoejtdpdqd?ZueNdrdsejvdtZweNdudvejxdwdxd?ZyeNdydzejzd{Z{dS)) annotationsN) defaultdict namedtuple) import_module) format_exc)AnsibleJinja2Filter)AnsibleJinja2Test) __version__) constants) AnsibleErrorAnsiblePluginCircularRedirectAnsiblePluginRemovedError(AnsibleCollectionUnsupportedVersionError)to_bytesto_text to_native) string_types) from_yaml) AnsibleLoader)get_plugin_class MODULE_CACHE PATH_CACHEPLUGIN_PATH_CACHE)AnsibleCollectionConfigAnsibleCollectionRef)_AnsibleCollectionFinder_get_collection_metadata)Display) add_fragments) _is_unsafe) SpecifierSet)Versionget_with_context_resultobjectplugin_load_contextcCsddtDS)NcSs"g|] \}}t|tr||fqS) isinstance PluginLoader).0nameobjr&r&A/usr/local/lib/python3.10/dist-packages/ansible/plugins/loader.py 9s"z*get_all_plugin_loaders..)globalsitemsr&r&r&r,get_all_plugin_loaders8sr0cCs~tjt|dd}tj|r4tD]\}}|jr1tj|t|j}tj|r1|t |qdSt dt |dS)z3 add any existing plugin dirs in the path provided surrogate_or_stricterrorszFIgnoring invalid path provided to plugin path: '%s' is not a directoryN) ospath expanduserrisdirr0subdirjoin add_directoryrdisplaywarning)r5b_pathr*r+ plugin_pathr&r&r,add_all_plugin_dirs<s  r?cCs|s>d}|r:t|tr9tj|}zt|}Wn ty#d}Ynw|dur9tD] }||j vr8|j }nq,nt dt|}|sKt d||rSt |d||S)Nshz;Either a shell type or a shell executable must be provided z.Could not find the shell plugin required (%s). executable) r'rr4r5basename shell_loaderget ExceptionallCOMPATIBLE_SHELLS SHELL_FAMILYr setattr) shell_typerAshell_filenameshellr&r&r,get_shell_pluginIs0        rMcCs0ttjtd|}|D] }|j|ddq dS)Nz %s_loaderT) with_subdir)getattrsysmodules__name__r:) which_loaderpathsloaderr5r&r&r,add_dirs_to_loaderjsrVc@seZdZddZdS)PluginPathContextcCs||_||_dSN)r5internal)selfr5rYr&r&r,__init__rs zPluginPathContext.__init__N)rR __module__ __qualname__r[r&r&r&r,rWqs rWc@s@eZdZddZeddZddZddZd d Zd d Z d S)PluginLoadContextcCsjd|_g|_g|_g|_g|_d|_d|_d|_d|_d|_ d|_ d|_ d|_ g|_ d|_d|_d|_dSNF) original_name redirect_list error_listimport_error_list load_attemptspending_redirect exit_reasonplugin_resolved_pathplugin_resolved_nameplugin_resolved_collection deprecated removal_dateremoval_versiondeprecation_warningsresolved_resolved_fqcn action_pluginrZr&r&r,r[xs" zPluginLoadContext.__init__cCsf|jsdS|js0|jd}t|r|dr|dd}|jr-t|s-|jd|}||_|jS)Nansible.legacy..)rnrorar is_valid_fqcr startswithsplitri)rZ final_pluginr&r&r, resolved_fqcns zPluginLoadContext.resolved_fqcncCs|s|S|ddp d}|dd}|dd}|durd}d||r%dnd|}tj||||dd|_|r:||_|r?||_|j||S) N warning_textrkrlz{0} has been deprecated.{1}{2} )dateversioncollection_nameT)rDformatr;rjrkrlrmappend)rZr* deprecationrrzrkrlr&r&r,record_deprecations    z$PluginLoadContext.record_deprecationcCs.d|_||_||_||_||_d|_||_|S)NT)rerhrgrirfrnrp)rZ resolved_name resolved_pathresolved_collectionrfrpr&r&r,resolveszPluginLoadContext.resolvecCs ||_d|j||_d|_|S)Nz+pending redirect resolution from {0} to {1}F)rerr`rfrn)rZ redirect_namer&r&r,redirectszPluginLoadContext.redirectcCsd|_||_d|_|Sr_)rerfrn)rZrfr&r&r,nopeszPluginLoadContext.nopeN) rRr\r]r[propertyryrrrrr&r&r&r,r^ws  r^c@seZdZdZddd Zd?d!d"Zd>d#d$Zd@d&d'Zd@d(d)Zd%dddefd*d+ZdAd,d-Zd?d.d/ZeZd0d1Zd.z%s/*z%s/*/*r1r2FcSrTrrr&r&r,r-trrcSs |jdS)Nz/windows)r5endswith)rr&r&r,s z6PluginLoader._get_paths_with_context..key)rrrr4r5abspathr6globrr7rrWextendrsort)rZrrr5contentscr&r&r,_get_paths_with_contextWs*     z$PluginLoader._get_paths_with_contextcCs|j|d}dd|DS)z1 Return a list of paths to search for plugins in rcSsg|]}|jqSr&)r5)r)path_with_contextr&r&r,r-sz+PluginLoader._get_paths..)r)rZrpaths_with_contextr&r&r,rs zPluginLoader._get_pathscCs|jrLt|j}|tjvrNtj||sPtt|dd|d}|rRt ||t |dkdd|vrTt |dt rVtj |||dtd||fdSdSdSdSdSdSdS) zf Reads plugin docs to find configuration setting definitions, to push to config manager for later use DOCUMENTATIONr{) file_namemodule)fragment_loader is_moduleoptionsz%Loaded config def from plugin (%s/%s)N)rrrCONFIGURABLE_PLUGINSrhas_configuration_definitionrrOget_single_datarrr'r+initialize_plugin_configuration_definitionsr;debug)rZr*rr5 type_namedstringr&r&r,_load_config_defss zPluginLoader._load_config_defsFcCs`tj|}|dur,|rtj||j}||jvr.|j||t d|dSdSdS)z1 Adds an additional directory to the search path NzAdded %s to loader search path) r4r5realpathr9r8rrrr;r)rZ directoryrNr&r&r,r:s   zPluginLoader.add_directorycCst|j}|s dSz t|jd|Wn tyYnwt|dd}|s)dS|jr6d|j|jg}n|j}|di|i||d}|sY|di|i|d}|S)Nz .plugins.{0}_collection_metartplugin_routing) r n_python_collection_package_namer ImportErrorrOrr9resourcerD)rZacr plugin_type extensioncollection_pkgcollection_metasubdir_qualified_resourceentryr&r&r,_query_collection_routing_metas$    z+PluginLoader._query_collection_routing_metac Csd|_t|j}t||}|j|||d}d}|r|dd} |s+||| |j|dd} | rl| d} | d} | dpCd } d || rKd nd | } t j | | | d |jd }| |_ | |_ d |_||_t||d|dd}|rt|std|jd|d|dt d |||||jvr|j|||S|jdkr|d}t|jdd}d |j|}|r||7}tj|j}|szt|j}Wnty|d |jYSwtj !|j"}tj #||}tj $|r |%|t&||jd ||j|S|r|d t&||jSddt'(tj #||dD}|s6|d ||jSt)|}t*|d!krKt +d"d##||%|t&|d$|jd% ||j|S)&zSearch builtin paths to find a plugin. No external paths are searched, meaning plugins inside roles inside collections will be ignored. F)rNr tombstonerkrlrzr{z{0} has been removed.{1}{2}r|T)msgr~r}removedrr%r Collection  contains invalid redirect for : 6. Redirects must use fully qualified collection names.z"redirecting (type: {0}) {1} to {2}rQrpstrictr2{0}.{1}zPython package {0} not foundz found exact match for {0} in {1}zno match for {0} in {1}cSs(g|]}tj|r|tjs|qSr&)r4r5isfilerrMODULE_IGNORE_EXTSr)fr&r&r,r-3s    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}),rnrrr8 from_fqcrrrDr collectionrr;get_deprecation_messagerkrlrfrrur vvrarrrrrn_python_package_namerPrQrrrr4r5rrr9existsrrriglobsortedlenr)rZfq_namerr%ignore_deprecatedrrrouting_metadatarprrrkrlrz removed_msgr n_resource full_namepkgpkg_pathn_resource_path found_filesr&r&r,_find_fq_plugins               zPluginLoader._find_fq_pluginr{cCs(||||||}|jr|jr|jSdS)z Find a plugin named name N)find_plugin_with_contextrnrg)rZr*mod_typer  check_aliasescollection_listresultr&r&r, find_pluginCs zPluginLoader.find_plugincCs~t}||_ |j||||||d}|jr.|j|jvr%td|j|j|j}d|_|}nnq|jr=t d||j|S)zg Find a plugin named name, returning contextual info about the load, recursively resolving redirection Trz.plugin redirect loop resolving {0} (path: {1})Nz;errors were encountered during the plugin load for {0}: {1}) r^r`_resolve_plugin_steprerar rrbr;r<)rZr*rr rrr%rr&r&r,rKs   z%PluginLoader.find_plugin_with_contextc s|std|jd|_t|jvrd|_|S|r#|}n|jr)d}nd}t s2|r߈ dsdvs=|sAg}n fdd |D}|D]y} z<|j | | d rg| d ||||}n|j| |||d }|jr~| |jvr~|j| |js|jr|WSWqLtttfyty} z |j| WYd} ~ qLd} ~ wty} z|jt| WYd} ~ qLd} ~ ww|jrtjd d|jdd|_|S| ||||S)NzA PluginLoadContext is requiredFz#{0} matched a defined plugin filterz.pyr{Ansiblertcsg|]}d|qS)r)r)r)rr*r&r,r-sz5PluginLoader._resolve_plugin_step..zansible.legacyrs)r%r z)plugin lookup for {0} failed; errors: {1}z; )rzno matches found for {0}) ValueErrorrarrn_PLUGIN_FILTERSrrrfrrrurvrd_find_plugin_legacy removeprefixrrerr rrrcrErbrr;rr9) rZr*rr rrr%suffix candidatescandidate_nameieexr&rr,risZ           z!PluginLoader._resolve_plugin_stepc sbd|_|r j||}j|}z#||}|j|_||_|jr"dnd|_|jr,d|n||_ d|_|WSt y=Ynwfdd DD]}|j}t |t d||j||j} zfd dtD} Wnty} zt d t| WYd } ~ nd } ~ wwd d| DD]|tj} tfd dtjDrqtj| } | d}z| d}Wn tyd}Ynwtdd|jdvrt| jd|<| jdvrt| jd| <|j|vrt| j||<| j|vrt| j|| <qj|z'||}|j|_||_|jr(dnd|_|jr3d|n||_ d|_|WSt yGYqIw|dsd|}||vr||}|sptj |jspt !d|"d|j|_||_|jr}dnd|_|jrd|n||_ d|_|Sd#|}d|vrt$%|rj&||||dS|'d#|S)zSearch library and various *_plugins paths in order to find the file. This was behavior prior to the existence of collections. Fansible.builtinr{ansible.builtin.Tc3s2|]}|jjvrtjt|jr|VqdSrX)r5rr4r7rrrqr&r, s0z3PluginLoader._find_plugin_legacy..z trying %sc3s|] }tj|VqdSrX)r4r5r9r)r=r&r,r'sz Error accessing plugin paths: %sNcss.|]}tj|r|dst|VqdS)s __init__.pyN)r4r5rrrrr&r&r,r's,c3s|]}|VqdSrX)r)r)r) full_pathr&r,r'srrr1r2_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}rt)rrr%r z.{0} is not eligible for last-chance resolution)(rnrrDrr5rgrhrYriroKeyErrorrrr;rrdrr4listdirOSErrorr<rrBanyrrsplitext IndexErrorrWraddrvislinkrjlstriprrrurr)rZr*r%r rr  pull_cacherr5rY full_pathser  splitname base_namer alias_namecandidate_fqcrr&)r=r(rZr,rs              z PluginLoader._find_plugin_legacyc Cs\z |j||dduWSty-}zt|trtdt|WYd}~dSd}~ww)z& Checks if a plugin named name exists rNzhas_plugin error: {0})rrEr'r r;rrr)rZr*rr$r&r&r, has_plugins "zPluginLoader.has_pluginc Cs|dr|}nd|j|g}|tjvrtj|St:tdtt j t |t |}t j |}|tj|<z|j|Wn tyOtj|=wWd|S1s[wY|S)Nansible_collections.rtignore)rvr9rrPrQwarningscatch_warnings simplefilterRuntimeWarning importlibutilspec_from_file_locationrmodule_from_specrU exec_modulerE)rZr*r5r specrr&r&r,_load_module_source*s*         z PluginLoader._load_module_sourcecCst|d|t|d|t|d|pgg}|r|||r)||ddd|s2td|t|d|t|d|ddS) N_original_path _load_name_redirected_namesrrzMissing FQCN for plugin source ansible_aliases ansible_namer)rIrrr )rZr+r*r5redirected_namesrnnamesr&r&r,_update_objectIs    zPluginLoader._update_objectcOs|j|g|Ri|jSrX)get_with_contextr$)rZr*argskwargsr&r&r,rD\szPluginLoader.getc Ost|r|}d}|dd}|dd}||jvr |j|}|jp$i|}r3|djr3t|S|j||d}|jr@|j sEtd|S|j } d| vrW|j rWd |j | f} |j } |j } |jpai| }rp|djrpt|S|jptg} | |jvr|| | |j| <d}|| |j| | t|j| |j} |jrt|j|jgd }zt||j}Wntytd|YSwt| |std|S|j|j| |j| ||d |s zt| }||| | | | | j|g|Ri||} Wn,ty}zd |j d vrt!"d | t#|ftd|WYd}~Sd}~ww|| | | | | |jdur>t| ddr>| |f|j| <n|jdurLdt$f|j| <t| |S)z9 instantiates a plugin of the given name using arguments T class_onlyFrNrr:rtfromlistfound_in_cacherTabstractrzHReturning not found on "%s" as it has unimplemented abstract methods; %s is_stateless)%r _strip_unsafepoprrrDrnr#rrgryrir9rhrarrHrrOrrrrAttributeError issubclass_display_plugin_loadrr$__new__rPr[ TypeErrorrRr;vrr^)rZr*rRrSrXrTr cached_resultr%rresolved_type_namer5rNr+r plugin_classinstancer5r&r&r,rQ_sl               zPluginLoader.get_with_contextcCsbtjr/d|tj||f}t|dkrd|||f}|s!|r(d|||f}t|dSdS)zd formats data to display debug info for plugin loading, also avoids processing unless really needed zLoading %s '%s' from %srz%s (searched paths: %s)z%%s (found_in_cache=%s, class_only=%s)N) r DEFAULT_DEBUGr4r5rBrrr;r)rZrr*searched_pathsr5rXrTrr&r&r,r_s z!PluginLoader._display_plugin_loadc os|dd}|dd}|dd}|r|rtdg}d}t}|D]"} tttj| jd} | j s=| | | t | tjj dq&t} |D]} tj| d } tj | }t|t}|ri| }n|}|s||t|jvr|td |qN|d ks|d kr|jd krtd| qN|r|| vrtd|qN| ||r| VqN| |vr|}nd|}|jpi|}r|djr|d VqN| |jvr|jdvrdtt| |}n|}z||| }Wnty }zt d| t!|fWYd}~qNd}~ww||j| <d}n|j| }|"||| zt#||j$}Wnt%yD}zt d| t!|fWYd}~qNd}~ww|j&rlt'|j|j&gd}zt#||j&}Wn t%ydYqNwt(||slqN|j)|j$||j*| ||d|sz ||i|}Wnt+y}zt d| t!|fWYd}~nd}~ww|j,||| |d|jdurd}t-|dr|j.}nt-|dr|j/}tj0ddd|s|1|d |VqNdS) a Iterate through all plugins of this type, in configured paths (no collections) A plugin loader is initialized with a specific type. This function is an iterator returning all of the plugins of that type to the caller. :kwarg path_only: If this is set to True, then we return the paths to where the plugins reside instead of an instance of the plugin. This conflicts with class_only and both should not be set. :kwarg class_only: If this is set to True then we return the python class which implements a plugin rather than an instance of the plugin. This conflicts with path_only and both should not be set. :kwarg _dedupe: By default, we only return one plugin per plugin name. Deduplication happens in the same way as the :meth:`get` and :meth:`find_plugin` methods resolve which plugin should take precedence. If this is set to False, then we return all of the plugins found, including those with duplicate names. In the case of duplicates, the order in which they are returned is the one that would take precedence first, followed by the others in decreasing precedence order. This should only be used by subclasses which want to manage their own deduplication of the plugins. :*args: Any extra arguments are passed to each plugin when it is instantiated. :**kwargs: Any extra keyword arguments are passed to each plugin when it is instantiated. _dedupeT path_onlyFrTHDo not set both path_only and class_only when calling PluginLoader.all()z*.pyrrz+'%s' skipped due to a defined plugin filterr[baseansible.plugins.cachez!'%s' skipped due to reserved namez'%s' skipped as duplicater&r)filtertestz{0}_{1}z%Skipping plugin (%s), cannot load: %sNz2Skipping plugin (%s) as it seems to be invalid: %srUrWz5Skipping plugin (%s) as it seems to be incomplete: %srnREQUIRES_ENABLEDREQUIRES_WHITELISTzaThe VarsModule class variable 'REQUIRES_WHITELIST' is deprecated. Use 'REQUIRES_ENABLED' instead.gq= ףp@r~)2r\r rrrrr4r5r9rYupdaterrrBr.r' Jinja2Loaderrrr;rr0rrDrnrrrabshashrHrEr<rrrOrr]rrr^r_rrarPrrqrrrjrQ)rZrRrSdeduperjrT all_matchesrXlegacy_excluding_builtinrmatchesloaded_modulesr5r*rBis_j2ref_namefqcnrcr rr5r+re needs_enabledr&r&r,rFs "                  "   zPluginLoader.allNNrrrXr{FFN)FFN)"rRr\r]__doc__r[rrrrrrrrrrrrrr:rrrrr^rrr; __contains__rHrPrDrQr_rFr&r&r&r,r(sB $    5    m  I k   Y r(csleZdZdZdfdd ZfddZdd d Zed d Zd dZ fddZ ddZ fddZ Z S)rua  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)Nrr)superrur[_plugin_wrapper_type_cached_non_collection_wrappers)rZrrrr8plugin_wrapper_typerr __class__r&r,r[ls zJinja2Loader.__init__cstt|i|_dSrX)rrurrrqrr&r,rqs zJinja2Loader._clear_cachesr{FcCstd)Nz,find_plugin is not supported on Jinja2Loader)NotImplementedError)rZr*rr rrr&r&r,ruszJinja2Loader.find_plugincCst|jdS)Ns)rrrqr&r&r,method_map_namexszJinja2Loader.method_map_namec CsZg}dd|d|j|g}z||jvr||||j|<|j|}t||j}Wnty?}z td||t|fd}~ww|} | durOtd||fz t| |j } | } Wn!ty}}zt d|jt ||f|WYd}~Sd}~ww| D]*\} } d|| f}d|| f}|| }||vrq|j||||d||q|S)Nrtansible_collectionspluginszFailed to load %s for %s: %szCould not find %s.%sz9Ignoring %s plugins in '%s' as it seems to be invalid: %rrp)r9rrrHrOrrEr*rrr/r;r<rrrPr)rZrr>r*rr rr+r5 plugin_impl method_map plugin_map func_namefuncrfullpluginr&r&r,get_contained_plugins|s>      z"Jinja2Loader.get_contained_pluginsc$ s|dd|ddt}|d}|j|i||j|}rBd|_||_|j|_ |j dr6dnd|_ |j |_ t||Sd}t|\}}t} || vrYtd |d | |t||j} | sntd |zt| j} Wnty} z td |t| d} ~ ww| d i|ji|i} | d}|r|dpd}|d}|d}|jd|d|rdnd|}tj|||| jd| d}|r |dpd}|d}|d}|jd|d|rdnd|}tj|||| jdd}t || dd}|rHt!|s.td| jd| jd| j"d|d t|| jd\}}t#d |j| j| j"||}nnqNzt$| j%}Wnt&yd} ztt| d} ~ ww| j}| j'rsd!|| j'}zt(j)|j*|dd"D]\}}}|rq~zt+t,|j-|g|Ri|}t.|j/|j0}|1}Wn#t2y} zt3d#|jd$|d%| WYd} ~ q~d} ~ ww|D]@\}}d4||f} d&| jd'|jd| j'd|}!||| fvr |5|}|r |j6}|j7||!|j/j| d(|j |_ nqːq~WnHt y%}"z tt|"d |"d)d}"~"wttfy/t2yW}#zt3d*t|#t#d+t8tt|#d |#d)d}#~#wwt||S),NrTFrrsTr&r%r{z*recursive collection redirect found for %rrzinvalid plugin name: {0}zInvalid plugin FQCN ({0}): {1}rrrzrkrlz "z" has been deprecated.r|)r~r}rrz" has been removed.)r~r}rrrrrrtrr)rz&redirecting (type: {0}) {1}.{2} to {3}r)prefixz Skipping z plugins in z$'; an error occurred while loading: r<z .plugins.rp)orig_excz>An unexpected error occurred during Jinja2 plugin loading: {0}z2Unexpected error during Jinja2 plugin loading: {0})9r\r^r_ensure_non_collection_wrappersrrDrnrhrIrgrMrvriror#get_fqcr_and_namerr r0rtry_parse_fqcrrr*rrrrrtitler;rjrrrurvvvrrrrpkgutil iter_modules__path__rrurQrOr$rr/rEr<r9rr%rPr)$rZr*rRrScontext known_pluginrrleaf_keyseenrtsr5 routing_entrydeprecation_entryrzrkrltombstone_entryexc_msgrnext_keyr parent_prefixdummy module_nameispkgrrrrrrsrc_nameaprer$rr&r,rQs         &   &   ";  "  zJinja2Loader.get_with_contextcos|dd|dd}|dd}|r|rtd|j|i||r4dd|jDEdHdSdd|jDEdHdS) NrirjFrTrkcss|]}|jVqdSrX)rIr)wr&r&r,r'4sz#Jinja2Loader.all..css|]}|VqdSrXr&rr&r&r,r'6s)r\r rrvalues)rZrRrSrjrTr&r&r,rF)s   zJinja2Loader.allc s|jrdStt|j|i|D]}|jd}t||j}z|}Wn tyC}zt d|j t |j |fWYd}~qd}~ww|D]}d|vr[t |d|j dqH|t|jvrjt d|qH|||} |} |jddkrd|jdddnd} || s| d|} |j| ||j | d || h} |r| d|| D]!} |j| }rt d | d |j d |j d q| |j| <qqHqdS)Nr&z9Skipping %s plugins in '%s' as it seems to be invalid: %rrtz skipped in z.; Jinja plugin short names may not contain "."z)%s skipped due to a defined plugin filterr{rpz Jinja plugin z from z" skipped; shadowed by plugin from ))rrrurFrMrvrOrrEr;vvvvrrrIkeysrrrrcountr9rwrPr0rD)rZrRrSp_map is_builtin plugins_listrr5 plugin_namewrapperrr target_names target_nameexisting_pluginrr&r,r8sL     .   z,Jinja2Loader._ensure_non_collection_wrappersrr)rRr\r]rr[rrrrrrQrFr __classcell__r&r&rr,ruds    &rur%cCs:d|vr|}|d|}||fS|dd}|}||fS)Nrtrr)rw)rrr*fqcrr&r&r,rhs rc Cst}d}tjdur d}ntj}d}tj|rt|d7}zt|}Wn&t yK}zt d |t ||WYd}~WdSd}~wwWdn1sVwYz|d}Wntytt d ||YSwt |}|}|dkrd |vrt jd d d d |vr|d |d <|d =z t|d |d<Wntyt d ||YSw|d|d<nt d |n |rt d |d|dvrtd t||S)NFz/etc/ansible/plugin_filters.ymlTrbz;The plugin filter file, {0} was not parsable. Skipping: {1}filter_versionz2The plugin filter file, {0} was invalid. Skipping.z1.0module_blacklistzC'module_blacklist' is being removed in favor of 'module_rejectlist'z2.18rsmodule_rejectlistansible.moduleszXUnable to parse the plugin filter file {0} as module_rejectlist 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.statzThe stat module was specified in the module reject list file, {0}, but Ansible will not function without the stat module. Please remove stat from the reject list.)rrPLUGIN_FILTERS_CFGr4r5ropenrreadrEr;r<rrr*striprj frozensetrar r)filtersuser_set filter_cfgr filter_datar5r~r&r&r,_load_plugin_filterssr          rc Csttd||t|}z/t|ddts9tj d}d|t}|dkr1t |WdS|dkrwarnrrCOLLECTIONS_PATHSrCOLLECTIONS_SCAN_SYS_PATH_installon_collection_loadr)prefix_collections_pathrTfinderr&r&r,_configure_collection_loaders  rcCstt|dS)aInitialize the plugin filters and the collection loaders This method must be called to configure and insert the collection python loaders into ``sys.meta_path`` and ``sys.path_hooks``. This method is only called in ``CLI.run`` after CLI args have been parsed, so that instantiation of the collection finder can utilize parsed CLI args, and to not cause side effects. N)rr)rr&r&r,init_plugin_loaders rModuleDocFragmentzansible.plugins.doc_fragments doc_fragments ActionModuleraction_plugins ActionBase)r CacheModulerm cache_pluginsCallbackModulezansible.plugins.callbackcallback_plugins Connectionzansible.plugins.connectionconnection_pluginsparamiko paramiko_sshConnectionBaser ShellModulezansible.plugins.shell shell_pluginsr{rlibraryzansible.module_utils module_utils LookupModulezansible.plugins.lookuplookup_plugins LookupBase FilterModulezansible.plugins.filterfilter_plugins TestModulezansible.plugins.test test_pluginsStrategyModulezansible.plugins.strategystrategy_plugins StrategyBaseTerminalModulezansible.plugins.terminalterminal_plugins TerminalBase VarsModulezansible.plugins.varsrCliconfzansible.plugins.cliconfcliconf_plugins CliconfBaseNetconfzansible.plugins.netconfnetconf_plugins NetconfBaseInventoryModulezansible.plugins.inventoryinventory_pluginsHttpApizansible.plugins.httpapihttpapi_plugins HttpApiBase BecomeModulezansible.plugins.becomebecome_pluginsr)r%rX)| __future__rrr4os.pathrrPr> collectionsrrrBr tracebackr"ansible.module_utils.compat.typingrcompattypingtrnrror ansibler rr ransible.errorsr r rr+ansible.module_utils.common.text.convertersrrransible.module_utils.sixransible.parsing.utils.yamlransible.parsing.yaml.loaderransible.pluginsrrrransible.utils.collection_loaderrr2ansible.utils.collection_loader._collection_finderrransible.utils.displayransible.utils.plugin_docsransible.utils.unsafe_proxyr packaging.specifiersr!packaging.versionr"rimportlib.utilrrr;r#r0r?rMrVr$rWr^r(rurrrrrrDOC_FRAGMENT_PLUGIN_PATHrDEFAULT_ACTION_PLUGIN_PATH action_loaderDEFAULT_CACHE_PLUGIN_PATH cache_loaderDEFAULT_CALLBACK_PLUGIN_PATHcallback_loaderDEFAULT_CONNECTION_PLUGIN_PATHconnection_loaderrCDEFAULT_MODULE_PATH module_loaderDEFAULT_MODULE_UTILS_PATHmodule_utils_loaderps_module_utils_loaderDEFAULT_LOOKUP_PLUGIN_PATH lookup_loaderDEFAULT_FILTER_PLUGIN_PATH filter_loaderDEFAULT_TEST_PLUGIN_PATH test_loaderDEFAULT_STRATEGY_PLUGIN_PATHstrategy_loaderDEFAULT_TERMINAL_PLUGIN_PATHterminal_loaderDEFAULT_VARS_PLUGIN_PATH vars_loaderDEFAULT_CLICONF_PLUGIN_PATHcliconf_loaderDEFAULT_NETCONF_PLUGIN_PATHnetconf_loaderDEFAULT_INVENTORY_PLUGIN_PATHinventory_loaderDEFAULT_HTTPAPI_PLUGIN_PATHhttpapi_loaderBECOME_PLUGIN_PATH become_loaderr&r&r&r,s~                !R"  @