Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyc

�
�Udac
@`s�ddlmZmZmZddlZddlmZededd�deddde�d	edd
ddd
gdd�dedd
��Z	ededd
��Z
ededdde�dedd
��ZddddddgZdd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�Zededdde�d#edd
dd$�d%eddde�d&edd'��Zdd(�Zdd)�Zd*�Z dS(+i(tabsolute_importtdivisiontprint_functionN(t
Connectiontauto_publish_sessionttypetboolt
wait_for_tasktdefaulttstatetstrtchoicestpresenttabsenttversiontnametuidtlayersexception-group-names	rule-namecC`s*|jd|||�\}}||fS(Ns	/web_api/(tsend_request(t
connectionRturltpayloadtcodetresponse((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyR7s cC`s8|dks0|dks0|dks0|dkr4tStS(NRR	RR(tFalsetTrue(t	parameter((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytis_checkpoint_param>sc	C`s�i}x�|D]�}||}|dk	r
t|�r
t|t�rct|�||jdd�<q�t|t�r�t|�dkr�t|dt�r�g}x!|D]}|jt|��q�W|||jdd�<q�|||jdd�<q
q
W|S(Nt_t-i(	tNoneRt
isinstancetdicttget_payload_from_parameterstreplacetlisttlentappend(tparamsRRtparameter_valuetpayload_listtelement_dict((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyR!Hs

4
c
C`s�i|d6}t}d}d}xT|ru||kru|d7}t||d|�\}}	d}
xs|dkr�|
dkr�|
d7}
tjd�t||d|�\}}	qcd	|	d
|	d
<|jd|	�qcWd}xg|	dD][}|d
dkr$|jddj|d|d��n|d
dkr8Pn|d7}q�W|t|	d�kret}q"tjd�q"W|s�|jddj|d��ndS(Nstask-idii,is	show-taski�iisVERROR: Failed to handle asynchronous tasks as synchronous, tasks result is undefined.
tmessagetmsgttaskststatustfailedsCTask {0} with task id {1} failed. Look at the logs for more detailss	task-namesin progresssERROR: Timeout.
Task-id: {0}.(RRttimetsleept	fail_jsontformatR$R(
tmoduleRRttask_idttask_id_payloadt
task_completetcurrent_iterationtmax_num_iterationsRRtattempts_countertcompleted_tasksttask((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyRZs:



	cC`sr|jdrnt||d�\}}|dkrD|jd|�n|jdrnt||||d�qnndS(NRtpublishi�R+Rstask-id(R&RR1R(R3RRtpublish_codetpublish_response((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pythandle_publish�s

c	C`st|j�}t|j�}|jjd�rEd|jddnd}t||||�\}}itd6}|dkr�|jdr�d|kr�t||||d�q�d	|kr�x(|d	D]}t||||�q�Wq�n|||<n|jd
dj	||��|S(NRtvt/ttchangedi�Rstask-idR,R+s5Checkpoint device returned error {0} with message {1}(
R!R&Rt_socket_pathtgetRRRR1R2(	R3tcommandRRRRRtresultR4((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytapi_command�s-


c	C`s�t|j�}t|j�}|jdr@d|jddnd}|jd�dkry|jd�dkry|}nt||d||�\}}|dkr�|jd	d
j||��ni||6}|S(NRR@RARBRRsshow-i�R+s5Checkpoint device returned error {0} with message {1}(	R!R&RRDRERRR1R2(	R3tapi_call_objecttapi_call_object_plural_versionRRRRRRG((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytapi_call_facts�s(*	
cC`s�t|j�}t|j�}itd6}|jr8|S|jjd�r_d|jddnd}i|d6|d6}t||d|�\}}|j�|d	<|d
ks�|dkr�|j	d|�n|d
kr�|ddkr�|j	dd�n|jddkr|dkr�|dst||d||�\}	}
|	dkre|j	d|
�nt
|||�t|d<|
||<qq�|d
kr�t||d||�\}	}
|	dkr�|j	d|
�nt
|||�t|d<|
||<q�n�|jddkr�|dkr�t|t
�}t||d||�\}	}
|	dkro|j	d|
�nt
|||�t|d<q�|d
kr�q�n|S(NRCRR@RARBRR&tequalstcheckpoint_session_uidi�i�R+i�Rtgeneric_err_command_not_foundscRelevant hotfix is not installed on Check Point server. See sk114661 on Check Point Support Center.R	Ri�sset-sadd-R
sdelete-(R!R&RRDRt
check_modeRERtget_session_uidR1R?Rt!get_copy_payload_with_some_paramst
delete_params(R3RIRRRGRtpayload_for_equalstequals_codetequals_responseRRtpayload_for_delete((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytapi_call�sR
	-




cC`s'd|kr|d}ndSt|�S(Ntposition(Rtint(RRRRX((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytget_number_from_position�s
c
C`st|||�}|dkr"tSi|dd6|dd6dd6}d|jd�dd	}|d
kr�|d|d<d}nt||||�\}}|d
|kr�tS|dd}	xd|	kr�|	dd}	q�W|	d|dkr�tStSdS(NRRitoffsettlimitsshow-Ris	-rulebasesthreat-exceptions	rule-names#show-threat-rule-exception-rulebasettotaltrulebase(RZRRtsplitRR(
RRRRItposition_numbert payload_for_show_access_rulebasetrulebase_commandRRtrule((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytis_equals_with_position_params"#	cC`s7t|�}x$|D]}||kr||=qqW|S(N(R (Rtparams_to_removetcopy_payloadtparam((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyt$get_copy_payload_without_some_params:s

cC`s8i}x+|D]#}||kr
||||<q
q
W|S(N((Rtparams_to_insertRfRg((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyRQCs

c	C`s�|rnd|krnt|dddg�}t||d||�\}}|dd}||dkrntSnt||||�s�tStS(NtactionRRRsshow-(RQRRRdR(	RRRRItis_access_ruletpayload_for_showRRtexist_action((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytis_equals_with_all_paramsLscC`s@d|krtnt}t|j�}t|j�}itd6}|jrP|S|jjd�rwd|jddnd}|r�t|ddg�}nt|dg�}i|d	6|d
6}t	||d|�\}	}
|j
�|d<|	d
ks|	dkr|jd|
�n|	dkrF|
ddkrF|jdd�n|jddkr�|	dkr-|
dr�t|||||�s�t|
d<q�n|
ds�d|kr�|d|d<|d=nt	||d||�\}}|dkr|jd|�nt
|||�t|d<|||<q�q<|	dkr<t	||d||�\}}|dkrw|jd|�nt
|||�t|d<|||<q<n�|jddkr<|	dkr*t|t�}
t	||d||
�\}}|dkr
|jd|�nt
|||�t|d<q<|	dkr<q<n|S(NtaccessRCRR@RARBRjRXRR&RLRMi�i�R+i�RRNscRelevant hotfix is not installed on Check Point server. See sk114661 on Check Point Support Center.R	Ri�snew-positionsset-sadd-R
sdelete-(RRR!R&RRDRORERhRRPR1RnR?RQRR(R3RIRkRRRGRt copy_payload_without_some_paramsRSRTRURRRV((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytapi_call_for_ruleZsf
	-






c	C`s�t|j�}t|j�}|jdr@d|jddnd}|jd�dkrd|}nt||d||�\}}|dkr�|jdd	j||��ni||6}|S(
NRR@RARBRsshow-i�R+s5Checkpoint device returned error {0} with message {1}(	R!R&RRDRERRR1R2(	R3RIRJRRRRRRG((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytapi_call_facts_for_rule�s(	
tpolicy_packagetstandardtauto_install_policyttargetsR#cC`s0d}|ri|d6}n|jd|�dS(NRs/web_api/publish(RR(RRR((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyR<�scC`s0d}|ri|d6}n|jd|�dS(NRs/web_api/discard(RR(RRR((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytdiscard�scC`s(i|d6|d6}|jd|�dS(Nspolicy-packageRvs/web_api/install-policy(R(RRsRvR((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pytinstall_policy�s

(!t
__future__RRRR/tansible.module_utils.connectionRR Rt$checkpoint_argument_spec_for_objectst"checkpoint_argument_spec_for_factst%checkpoint_argument_spec_for_commandsRRRRRR!RR?RHRKRWRZRdRhRQRnRqRrtcheckpoint_argument_specR<RwRx(((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/checkpoint/checkpoint.pyt<module>sF!	
		+	
			?		#						K			

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]