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

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyo
�
��\c@`s�ddlmZmZmZeZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZyddlmZWn*ek
r�ddlmZe�ZnXd	efd
��YZd�Zdd�ZdS(
i(tabsolute_importtdivisiontprint_functionN(tto_text(tConnectionError(tto_list(tHttpApiBase(tdisplay(tDisplaytHttpApicB`sDeZd�Zd�Zeed�Zed�Zeed�ZRS(c	K`s4t|�}|jrFtjd�|jdidd6|jd6�n|jdd�}t||�}idd	6}|jj	d
|d|dd
�\}}yt
jt|j
���}Wn2tk
r�tdjt|j
�����nXt|�}|jr|d}nt|�dkr0|d}n|S(Nsfiring event: on_becomeitenabletcmdtinputtoutputttextsapplication/json-rpcsContent-Types/command-apitheaderstmethodtPOSTs$Response was not valid JSON, got {0}i(Rt_becomeRtvvvvtinsertt_become_passtgettrequest_buildert
connectiontsendtjsontloadsRtgetvaluet
ValueErrorRtformatthandle_responsetlen(	tselftdatatmessage_kwargsR
trequestRtresponset
response_datatresults((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pytsend_requests&	
$
'
		

cC`s|jr
dSdS(Nt#t>(R(R!((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyt
get_prompt3s	cC`s�dttj��}i|d6}d}g}d|g}|rR|jd�nx�|D]�}	|	jd�r}|	}g}qY|r�|	dkr�i|d6dj|�d	6}	d}|j|	�q�|j|	�qYqY|j|	�qYWy|j|�}
Wn9tk
r4d|d
g}|j|dd�}
�nXd|d
g}|r[|jd�n
|jd
�|j|dd�}
|
dj�}|r�||d<n|S(sLoads the configuration onto the remote devices

        If the device doesn't support configuration sessions, this will
        fallback to using configure() to load the commands.  If that happens,
        there will be no returned diff or session values
        s
ansible_%stsessionsconfigure session %ssrollback clean-configtbannertEOFRs
RtabortR
Rsshow session-config diffstcommititdiffN(	tintttimetNonetappendt
startswithtjoinR(t	Exceptiontstrip(R!tconfigR0treplaceR,tresultt
banner_cmdtbanner_inputtcommandstcommandR%R1((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pytedit_config:sD


	



c
`sd
}t�}t�}��fd�}x�t|�D]�}d}t|t�rx|d}	d|kr~|d}q~n|}	|	jd�r�|	jdd�d}	d	}n|r�||kr�|j|||��t�}n|}|j|	�q7W|r|j|||��n|S(sCRuns list of commands on remote device and returns results
        c`s}yt�j|d|��}Wn&tk
rG}�r=�nt|�SX|dkryg|D]}tj|�^q[}n|S(NR
R(RR(R8RRR(tqueueR
R%texctitem(tcheck_rcR!(s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyt	run_queuets%RR@R
s| jsont|iiRN(	R4tlistRt
isinstancetdicttendswithtrsplittextendR5(
R!R?RER
RBt	responsesRFRDt
cmd_outputR@((RER!s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pytrun_commandsms,		
	cC`s|j|||�S(sLoads the configuration onto the remote devices

        If the device doesn't support configuration sessions, this will
        fallback to using configure() to load the commands.  If that happens,
        there will be no returned diff or session values
        (RA(R!R:R0R;((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pytload_config�s(	t__name__t
__module__R(R+tFalseRAtTrueRPRQ(((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyR	s
		3-cC`s�d|kr||d}g}x+|dD]}|j|jdg��q'Wdj|�p`|d}t|d|d��ng}xr|dD]f}d|kr�|j|dd	�q�d
|kr�|j|d
j��q�|jtj|��q�W|S(NterrorR"terrorss
tmessagetcodeR<tmessagesiR
(RMRR7RR5R9Rtdumps(R%RVt
error_textR"R'R<((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyR�s
c
C`sCtddd|d|�}tjtddd|dd	d
|��S(NtversionitcmdsRtjsonrpcs2.0tidRtrunCmdstparams(RJRR[(R?R
treqidRb((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyR�s(t
__future__RRRttypet
__metaclass__RR3tansible.module_utils._textRtansible.module_utils.connectionRt)ansible.module_utils.network.common.utilsRtansible.plugins.httpapiRt__main__RtImportErrortansible.utils.displayRR	RR4R(((s?/usr/lib/python2.7/site-packages/ansible/plugins/httpapi/eos.pyt<module>s

�	

Anon7 - 2022
AnonSec Team