Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/ftd/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyo

�
�Udac@s!ddlZddlmZddlmZddlmZdZdddgZed	d
gZ	ddd��YZ
d
dd��YZdefd��YZ
defd��YZdefd��YZd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�ZdS( i����N(tto_text(t	is_string(t	iteritemss
[^a-zA-Z0-9_]tidtversiontruleIdtisSystemDefinedtlinkst
HTTPMethodcBs eZdZdZdZdZRS(tgettposttputtdelete(t__name__t
__module__tGETtPOSTtPUTtDELETE(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyRstResponseParamscBseZdZdZdZRS(tsuccesststatus_codetresponse(R
RtSUCCESStSTATUS_CODEtRESPONSE(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR%stFtdConfigurationErrorcBseZdd�ZRS(cCs,tt|�j|�||_||_dS(N(tsuperRt__init__tmsgtobj(tselfRR((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR,s	N(R
RtNoneR(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR+stFtdServerErrorcBseZd�ZRS(cCs,tt|�j|�||_||_dS(N(RR!RRtcode(RRR"((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR3s	(R
RR(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR!2stFtdUnexpectedResponsecBseZdZRS(sKThe exception to be raised in case of unexpected responses from 3d parties.(R
Rt__doc__(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyR#9scCs�t�}|r�d|kr%|dn|}|jd�rK|||d<q�t|�tkr�|jd�r�|jd�r�tjtd|dj��}d|d|f}|||<q�n|S(Ntitemstregister_astnamettypet_s%s_%s(tdictR	R(tretsubtINVALID_IDENTIFIER_SYMBOLStlower(Rtparamstfactst
response_bodytobject_namet	fact_name((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytconstruct_ansible_facts>s	0cCs2x+tD]#}||kr||||<qqW|S(N(tIDENTITY_PROPERTIES(t
source_objtdest_objt
property_name((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytcopy_identity_propertiesKs
cCsBd|j�ko|d}d|j�ko5|d}|oA|S(s
    Checks if a dictionary is a reference object. The dictionary is considered to be a
    reference object when it contains non-empty 'id' and 'type' fields.

    :type d: dict
    :return: True if passed dictionary is a reference object, otherwise False
    RR((tkeys(tdthas_idthas_type((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyt
is_object_refRscCs2|d|dk}|d|dk}|o1|S(s�
    Checks whether two references point to the same object.

    :type d1: dict
    :type d2: dict
    :return: True if passed references point to the same object, otherwise False
    RR(((td1td2thave_equal_idsthave_equal_types((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytequal_object_refs_scCsSt|�t|�krtSx0t||�D]\}}t||�s,tSq,WtS(s�
    Checks whether two lists are equal. The order of elements in the arrays is important.

    :type l1: list
    :type l2: list
    :return: True if passed lists, their elements and order of elements are equal. Otherwise, returns False.
    (tlentFalsetziptequal_valuestTrue(tl1tl2tv1tv2((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytequal_listslscCs�|r+t|�r+t|�r+t||�St|�t|�krGtSxG|j�D]9\}}||krptS||}t||�sTtSqTWtS(s�
    Checks whether two dictionaries are equal. If `compare_by_reference` is set to True, dictionaries referencing
    objects are compared using `equal_object_refs` method. Otherwise, every key and value is checked.

    :type d1: dict
    :type d2: dict
    :param compare_by_reference: if True, dictionaries referencing objects are compared using `equal_object_refs` method
    :return: True if passed dicts are equal. Otherwise, returns False.
    (R>RCRDRER%RGRH(R?R@tcompare_by_referencetkeyRKRL((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytequal_dicts~s


cCs�t|�r.t|�r.t|�t|�kSt|�t|�krJtSt|�}|tkrot||�S|tkr�t||�S||kSdS(s4
    Checks whether types and content of two values are the same. In case of complex objects, the method might be
    called recursively.

    :param v1: first value
    :param v2: second value
    :return: True if types and content of passed values are equal. Otherwise, returns False.
    :rtype: bool
    N(RRR(REtlistRMR*RP(RKRLt
value_type((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyRG�s

cCs4d�}||�}||�}t||dt�S(s

    Checks whether two objects are equal. Ignores special object properties (e.g. 'id', 'version') and
    properties with None and empty values. In case properties contains a reference to the other object,
    only object identities (ids and types) are checked. Also, if an array field contains multiple references
    to the same object, duplicates are ignored when comparing objects.

    :type d1: dict
    :type d2: dict
    :return: True if passed objects and their properties are equal. Otherwise, returns False.
    cs2t�fd��j�D���t����S(Nc3s5|]+}|tkr�|r|�|fVqdS(N(tNON_COMPARABLE_PROPERTIES(t.0tk(R;(sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pys	<genexpr>�s(R*R:tdelete_ref_duplicates(R;((R;sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytprepare_data_for_comparison�s"RN(RPRE(R?R@RW((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyt
equal_objects�s	cCs�d�}|s|Si}xnt|�D]`\}}t|�tkrW||�||<q&t|�tkr|t|�||<q&|||<q&W|S(s*
    Removes reference duplicates from array fields: if an array contains multiple items and some of
    them refer to the same object, only unique references are preserved (duplicates are removed).

    :param d: dict with data
    :type d: dict
    :return: dict without reference duplicates
    cSs�td�|D��r�t�}t�}xK|D]C}|d|df}||kr/|j|�|j|�q/q/Wt|�S|SdS(Ncss-|]#}t|�tko$t|�VqdS(N(R(R*R>(RTti((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pys	<genexpr>�sRR((talltsetRQtaddtappend(trefstunique_refstunique_listRYRO((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pytdelete_ref_duplicates_from_list�s		


(RR(RQR*RV(R;Rat
modified_dRUtv((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyRV�s
	(((R+tansible.module_utils._textRt'ansible.module_utils.common.collectionsRtansible.module_utils.sixRR-R5RSRRt	ExceptionRR!R#R4R9R>RCRMRHRPRGRXRV(((sK/usr/lib/python2.7/site-packages/ansible/module_utils/network/ftd/common.pyt<module>s(	
		
	
			

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