AnonSec Shell
Server IP : 85.193.89.191  /  Your IP : 52.14.31.151
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/inventory/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyo
�
��\c@`s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mZddlm
Z
mZddlmZddlmZddlmZmZddlmZdd	lmZdd
lmZddlmZyddlmZWn*e k
r.dd
l!m"Z"e"�ZnXej#d�Z$d�Z%dd�Z'dd�Z(defd��YZ)de)fd��YZ*de+fd��YZ,de+fd��YZ-dS(i(tabsolute_importtdivisiontprint_functionN(tMapping(tAnsibleErrortAnsibleParserError(t
AnsiblePlugin(tInventoryFileCacheModule(tto_bytest	to_native(tboolean(tstring_types(tTemplar(tcombine_vars(tdisplay(tDisplays
[^A-Za-z0-9_]cC`stjd|�S(se Converts 'bad' characters in a string to underscores so they can be used as Ansible hosts or groups t_(t_SAFE_GROUPtsub(tname((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytto_safe_group_name0scC`s
d|kS(s�
    A helper function that checks a given host line to see if it contains
    a range pattern described in the docstring above.

    Returns True if the given line contains a pattern, else False.
    t[((tline((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytdetect_range5sc`sSg}|rO|jddd�jddd�jd�\}}}|jd�}t|�dkr�t|�dkr�td��n|d	}|d}t|�dkr�d}n
|d}|s�d
}n|s�td��n|d	d
krBt|�dkrBt|���t|�kr0td��n�fd
�}	nt}	yitjj|�}
tjj|�}|
|kr�td��nttj|
|dt	|���}Wn9t
k
r�tt	|�t	|�dt	|��}nXx[|D]S}
dj||	|
�|f�}t
|�r:|jt|��q�|j|�q�W|SdS(s�
    A helper function that expands a given line that contains a pattern
    specified in top docstring, and returns a list that consists of the
    expanded version.

    The '[' and ']' characters are used to maintain the pseudo-code
    appearance. They are replaced in this function with '|' to ease
    string splitting.

    References: https://docs.ansible.com/ansible/latest/user_guide/intro_inventory.html#hosts-and-groups
    Rt|it]t:iis.host range must be begin:end or begin:end:stepit0s!host range must specify end values:host range must specify equal-length begin and end formatsc`st|�j��S(N(tstrtzfill(tx(trlen(sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytfillmss!host range must have begin <= endtN(treplacetsplittlenRRtstringt
ascii_letterstindextlisttintt
ValueErrortrangetjoinRtextendtexpand_hostname_rangetappend(Rt	all_hoststheadtnrangettailtboundstbegtendtstepR ti_begti_endtseqtrseqthname((RsF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR.?sF6$

	
	"*
,
tBaseInventoryPlugincB`seeZdZdZd�Zed�Zd�Zd
d
d�Z	d�Z
d�Zd�Zd	�Z
RS(s Parses an Inventory Sourcet	generatorcC`s;tt|�j�i|_d|_t|_d|_dS(N(tsuperR=t__init__t_optionstNonet	inventoryRtcache(tself((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR@�s
			cC`s(||_||_td|�|_dS(sz Populates inventory from the given data. Raises an error on any parse failure
            :arg inventory: a copy of the previously accumulated inventory data,
                 to be updated with any new data this plugin provides.
                 The inventory can be empty if no other source/plugin ran successfully.
            :arg loader: a reference to the DataLoader, which can read in YAML and JSON files,
                 it also has Vault support to automatically decrypt files.
            :arg path: the string that represents the 'inventory source',
                 normally a path to a configuration file for this inventory,
                 but it can also be a raw string for this plugin to consume
            :arg cache: a boolean that indicates if the plugin should use the cache or not
                 you can ignore if this plugin does not implement caching.
        tloaderN(RFRCRttemplar(RERCRFtpathRD((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytparse�s		cC`s\t}t|dd�}tjj|�rHtj|tj�rHt}n|jj	d�|S(s� Verify if file is usable by this plugin, base does minimal accessibility check
            :arg path: a string that was passed as an inventory source,
                 it normally is a path to a config file, but this is not a requirement,
                 it can also be parsed itself as the inventory data to process.
                 So only call this base class if you expect it to be a file.
        terrorstsurrogate_or_strictsWSkipping due to inventory source not existing or not being readable by the current user(
tFalseRtosRHtexiststaccesstR_OKtTrueRtvvv(RERHtvalidtb_path((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytverify_file�s'	cC`s�t|t�s(tdt|���nxU|D]M}|jj|d|d|�x(|D] }|jj||||�qXWq/WdS(Ns8Invalid data from file, expected dictionary and got:

%stgrouptport(t
isinstanceRRR	RCtadd_hosttset_variable(REthostst	variablesRVRWthosttk((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_populate_host_vars�s

cC`si}y|jj|dt�}Wn%tk
rI}tt|���nX|sitdt|���n_|jd�|jkr�td|jdd���n(t|t	�s�tdt
|���n|jd|�|jjd�r�|j
|j�n|S(s� validate config and set options as appropriate
            :arg path: path to common yaml format config file for this plugin
        RDs%s is emptytplugins!Incorrect plugin name in file: %ss
none foundsJinventory source has invalid structure, it should be a dictionary, got: %stdirect(RFtload_from_fileRLt	ExceptionRR	tgettNAMERXRttypetset_optionsRAt_set_cache_options(RERHtconfigte((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_read_config_data�scC`s=td|jd�d|jd�d|jd��|_dS(Ntplugin_nametcache_pluginttimeoutt
cache_timeoutt	cache_dirtcache_connection(RRdRD(REtoptions((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyRh�scC`s=x6|jD]+}||kr
|j|�|j|<q
q
WdS(s< update existing options from alternate configuration sources not normally used by Ansible.
            Many API libraries already have existing configuration sources, this allows plugin author to leverage them.
            :arg data: key/value pairs that correspond to configuration options for this plugin
        N(RAtpop(REtdataR^((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_consume_options�scC`sdS(N((RE((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pytclear_cache�sN(t__name__t
__module__t__doc__tTYPER@RQRIRURBR_RkRhRuRv(((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR=�s							
tBaseFileInventoryPlugincB`seZdZdZd�ZRS(s% Parses a File based Inventory SourcetstoragecC`stt|�j�dS(N(R?R{R@(RE((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR@�s(RwRxRyRzR@(((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR{�st	CacheablecB`s)eZiZd�Zd�Zd�ZRS(cC`sdj|j|j|��S(Ns{0}_{1}(tformatRet_get_cache_prefix(RERH((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt
get_cache_key�scC`s�tj�}|jt|jdd��|j�}tj�}|jt|dd��|j�}dj|d |d g�S(s7 create predictable unique prefix for plugin/inventory RJRKts_i(thashlibtsha1tupdateRRet	hexdigestR,(RERHtmtd1tntd2((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyRscC`s
i|_dS(N(t_cache(RE((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyRvs(RwRxR�R�RRv(((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR}�s		
t
ConstructablecB`s5eZd�Zed�Zed�Zed�ZRS(cC`sB|j}|j|�|jd|jj||jjfdt�S(si helper method for plugins to compose variables for Ansible based on jinja2 expression and inventory varss%s%s%stdisable_lookups(RGtset_available_variablesttemplatetenvironmenttvariable_start_stringtvariable_end_stringRQ(RER�R\tt((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_composes	
cC`s�|r�t|t�r�x�|D]w}y|j|||�}Wn>tk
r|}|rtd||t|�f��qqnX|jj|||�qWndS(s5 loops over compose entries to create vars for hosts s Could not set %s for host %s: %sN(RXtdictR�RcRR	RCRZ(REtcomposeR\R]tstricttvarnamet	compositeRj((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_set_composite_varss
"c	C`s�|r�t|t�r�t||jj|�j��}|jj|�x�|D]�}d||}yt|jj	|��}Wn>t
k
r�}|rMtd||t|�f��qMqMnX|rM|jj
|�|jj||�qMqMWndS(s} helper to create complex groups for plugins based on jinja2 conditionals, hosts that meet the conditional are added to groups3{%% if %s %%} True {%% else %%} False {%% endif %%}s%Could not add host %s to group %s: %sN(RXR�R
RCtget_hosttget_varsRGR�R
R�RcRR	t	add_groupt	add_child(	REtgroupsR\R]R�t
group_nametconditionaltresultRj((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_add_host_to_composed_groups&s!
"c	C`s?|r;t|t�r;g}x�|D]�}|r�t|t�r�t||jj|�j��}y|j|jd�|�}WnDt	k
r�}|r"t
d|jd�t|�f��q"q"nX|r�|jdd�}	|jdd�}
t|t�r|j
d|	|
|f�q�t|t�rWx�|D] }|j
d|	|
|f�q0Wq�t|t�r�x`|j�D]9\}}
d||
|
f}|j
d|	|
|f�qsWq�t
dt|���q�|r�t
d	��q�q"t
d
|��q"Wx@|D]5}t|�}|jj|�|jj||�q�WndS(sc helper to create groups for plugins based on variable values and add the corresponding hosts to ittkeys*Could not generate group from %s entry: %stprefixR!t	separatorRs%s%s%ssUInvalid group name format, expected a string or a list of them or dictionary, got: %ss+No key or key resulted empty, invalid entrys7Invalid keyed group entry, it must be a dictionary: %s N(RXR(R�R
RCR�R�R�RdRcRR	RR/RtitemsRfRR�R�(REtkeysR\R]R�R�tkeyedR�RjR�tsepRtgnametgvalR�((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt_add_host_to_keyed_groups;s>
!(
!!
(RwRxR�RLR�R�R�(((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyR�s	(.t
__future__RRRRft
__metaclass__R�RMtreR%tcollectionsRtansible.errorsRRtansible.pluginsRtansible.plugins.cacheRtansible.module_utils._textRR	t)ansible.module_utils.parsing.convert_boolR
tansible.module_utils.sixRtansible.templateRtansible.utils.varsR
t__main__RtImportErrortansible.utils.displayRtcompileRRRBRR.R=R{tobjectR}R�(((sF/usr/lib/python2.7/site-packages/ansible/plugins/inventory/__init__.pyt<module>s6

	
Hi


Anon7 - 2022
AnonSec Team