Anons79 Mini Shell

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

�
�Udac@s�dd,d��YZidd6dd6Ziiidd6ed6ed6d	6id
d6ed6d6id
d6ed6ed6d	dgd6d6idd6d6idd6ed6ed6d	dgd6d6idd6ed6ed6d6idd6d6idd6ed6d6idd6ed6ed6d6idd6ed6ed6d6idd6d	dgd6ed6ed6d6id d6ed6ed6d!6d"6Zdid#d6fZid$d6Zd%efd&��YZd'e	fd(��YZ
d)�Zd*�Zd+S(-tFMGRMethodscBsDeZdZdZdZdZdZdZdZdZ	dZ
dZRS(	tgettsettexectupdatetaddtdeletetreplacetclonetmove(t__name__t
__module__tGETtSETtEXECtEXECUTEtUPDATEtADDtDELETEtREPLACEtCLONEtMOVE(((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyRssapplication/jsonsContent-TypetAccepttOKtmsgtchangedtstop_on_successisnModule returned without actually running anything. Check parameters, and please contact the authors if needed.tfailedi`y��sObject already exists.tskippedi����t
good_codess�Invalid Url. Sometimes this can happen because the path is mapped to a hostname or object that doesn't exist. Double check your input object parameters.i����sObject doesn't exist.i����sCObject dependency failed. Do all named objects in parameters exist?im��s�Duplicate object. Try using mode='set', if using add. STOPPING. Use 'ignore_errors=yes' in playbookto override and mark successful.i���sDevice Unreachable.i����s5Duplicate object. Try using mode='set', if using add.i���i���sCDevice already added to FortiManager. Serial number already in use.iֱ��s;Invalid Argument -- Does this Device exist on FortiManager?iޱ��tfmgr_return_codess=Nothing Happened. Check that handle_response is being called!s^Socket Path Empty! The persistent connection manager is messed up. Try again in a few moments.tFMGBaseExceptioncBseZdZdd�ZRS(sWrapper to catch the unexpectedcOs2|dkrd}ntt|�j||�dS(NsKAn exception occurred within the fortimanager.py httpapi connection plugin.(tNonetsuperRt__init__(tselfRtargstkwargs((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyR"}s	N(R
Rt__doc__R R"(((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyRzst
FMGRCommoncBsSeZed��Zed��Zed��Zed��Zed��ZRS(cOs�i|d6g}|r;x"|D]}|dj|�qWn|r�t|�}x-|D]%}|j|�||jdd�<qTW|dks�|dkr�|dj|�q�|jdt�r�|d|dd<q�||dd<n|S(s�
        Formats the payload from the module, into a payload the API handler can use.

        :param url: Connection URL to access
        :type url: string
        :param method: The preferred API Request method (GET, ADD, POST, etc....)
        :type method: basestring
        :param kwargs: The payload dictionary from the module to be converted.

        :return: Properly formatted dictionary payload for API Request via Connection Plugin.
        :rtype: dict
        turlit__t-RRtdata(RtlisttpopRRtFalse(tmethodR(R$R%tparamstargtkeylisttk((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pytformat_request�s

#cCs�d}t|t�r�t|�dkr�x�|j�D]s\}}t|t�r4t�}d|kr�|jd�}x!|D]}|j|j��qzW|||<q�q4q4W|}q�n-t|t�r�|j	dd�jd�}n|S(s
        Splits a CSV String into a list.  Also takes a dictionary, and converts any CSV strings in any key, to a list.

        :param obj: object in CSV format to be parsed.
        :type obj: str or dict

        :return: A list containing the CSV items.
        :rtype: list
        it,t t((
t
isinstancetdicttlentitemststrR,tsplittappendtstripR(tobjt
return_objR3tvtnew_listt	new_itemstitem((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pytsplit_comma_strings_into_lists�s	
cCs�t|t�r�t|�}dd|?d|>}td|@d?�dtd|@d?�dtd|@d	?�dtd
|@�SdS(sc
        Converts a CIDR Network string to full blown IP/Subnet format in decimal format.
        Decided not use IP Address module to keep includes to a minimum.

        :param cidr: String object in CIDR format to be processed
        :type cidr: str

        :return: A string object that looks like this "x.x.x.x/y.y.y.y"
        :rtype: str
        I����i I�it.i�ii�ii�N(R8R<tint(tcidrtmask((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pytcidr_to_netmask�scCs�t|�dkr�xz|D]o}y=|jdd�}|j|}|r[||=|||<nWqtk
r�}tdt|���qXqWn|S(s�
        If a list of items was provided to a "parent" paramgram attribute, the paramgram needs to be rewritten.
        The child keys of the desired attribute need to be deleted, and then that "parent" keys' contents is replaced
        With the list of items that was provided.

        :param list_overrides: Contains the response from the FortiManager.
        :type list_overrides: list
        :param paramgram: Contains the paramgram passed to the modules' local modify function.
        :type paramgram: dict
        :param module: Contains the Ansible Module Object being used by the module.
        :type module: classObject

        :return: A new "paramgram" refactored to allow for multiple entries being added.
        :rtype: dict
        iR*t_s>Error occurred merging custom lists for the paramgram parent: (R:RR0t
BaseExceptionRR<(tlist_overridest	paramgramtmodulet
list_variablet
override_datate((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pytparamgram_child_list_override�s

!cCs,y|jd|�Wntk
r'nXdS(NR(tlogRM(RPR((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pytsyslog�s
(R
RtstaticmethodR4RFRKRTRV(((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyR'�s
 csMdddddg�t|t�rIt�fd�|j�D��}n|S(s"
    Removes any keys from a dictionary that are only specific to our use in the module. FortiManager will reject
    requests with these empty/None keys in it.

    :param obj: Dictionary object to be processed.
    :type obj: dict

    :return: Processed dictionary.
    :rtype: dict
    tmodetadomthosttusernametpasswordc3s3|])\}}|�kr|t|�fVqdS(N(tprepare_dict(t.0tkeytvalue(t
list_of_elems(sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pys	<genexpr>
s(R8R9R;(R@((RasT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyR]�s%cCs1t|t�r)td�|j�D��S|SdS(s
    Removes any keys from a dictionary that are EMPTY -- this includes parent keys. FortiManager doesn't
    like empty keys in dictionaries

    :param obj: Dictionary object to be processed.
    :type obj: dict

    :return: Processed dictionary.
    :rtype: dict
    css9|]/\}}|rt|�r|t|�fVqdS(N(t
scrub_dict(R^R3RB((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pys	<genexpr>sN(R8R9R;(R@((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyRbsN((
RtBASE_HEADERStTrueR.tFMGR_RCtDEFAULT_RESULT_OBJtFAIL_SOCKET_MSGt	ExceptionRtobjectR'R]Rb(((sT/usr/lib/python2.7/site-packages/ansible/module_utils/network/fortimanager/common.pyt<module>sp



x	

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