Anons79 Mini Shell

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

�
�Udac@`s�dZddlmZmZmZeZddlmZddl	m
Z
ddlmZddl	m
Z
ddlmZddl	mZdd	lmZd
efd��YZdS(
s�
The iosxr_lacp class
It is in this file where the current configuration (as dict)
is compared to the provided configuration (as dict) and the command set
necessary to bring the current configuration to it's desired end-state is
created
i(tabsolute_importtdivisiontprint_function(t
ConfigBase(tto_list(tFacts(t	dict_diff(t	iteritems(tremove_empties(tflatten_dicttLacpcB`s}eZdZddgZdgZd�Zd�Zd�Zd�Zd�Z	e
d	��Ze
d
��Ze
d��Z
RS(s
    The iosxr_lacp class
    s!alls!mintlacpcC`stt|�j|�dS(N(tsuperR
t__init__(tselftmodule((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR
+scC`sHt|j�j|j|j�\}}|djd�}|sDiS|S(s� Get the 'facts' (the current configuration)

        :rtype: A dictionary
        :returns: The current configuration as a dictionary
        tansible_network_resourcesR(Rt_modulet	get_factst
gather_subsettgather_network_resourcestget(Rtfactst	_warningst
lacp_facts((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pytget_lacp_facts.s
'cC`s�itd6}t�}t�}|j�}|j|j|��|rs|jjsf|jj|�nt	|d<n||d<|j�}||d<|dr�||d<n||d<|S(sm Execute the module

        :rtype: A dictionary
        :returns: The result from module execution
        tchangedtcommandstbeforetaftertwarnings(
tFalsetlistRtextendt
set_configRt
check_modet_connectiontedit_configtTrue(RtresultRRtexisting_lacp_factstchanged_lacp_facts((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pytexecute_module:s 
		





cC`sF|jjjd�}|s$i}n|}|j||�}t|�S(s! Collect the configuration from the args passed to the module,
            collect the current configuration (as a dict from facts)

        :rtype: A list
        :returns: the commands necessary to migrate the current configuration
                  to the desired configuration
        tconfig(RtparamsRt	set_stateR(RR(twantthavetresp((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR"Us	cC`s�|jjd}|dkrB|rB|jjddj|��n|dkrc|j||�}nB|dkr�|j||�}n!|dkr�|j||�}n|S(sX Select the appropriate function based on the state provided

        :param want: the desired configuration as a dictionary
        :param have: the current configuration as a dictionary
        :rtype: A list
        :returns: the commands necessary to migrate the current configuration
                  to the desired configuration
        tstatetmergedtreplacedtmsgs9value of config parameter must not be empty for state {0}tdeleted(R2R3(RR,t	fail_jsontformatt_state_deletedt
_state_mergedt_state_replaced(RR.R/R1R((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR-ds	cC`s<g}|jtj||��|jtj||��|S(s� The command generator when state is replaced

        :rtype: A list
        :returns: the commands necessary to migrate the current configuration
                  to the desired configuration
        (R!R
R8R9(R.R/R((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR:zscC`stg}t||�}|rpxRttt|d���D]1\}}|jdj|jdd�|��q8Wn|S(s� The command generator when state is merged

        :rtype: A list
        :returns: the commands necessary to merge the provided into
                  the current configuration
        tsystemslacp system {0} {1}taddresstmac(RRR	RtappendR7treplace(R.R/Rtupdatestkeytvalue((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR9�s),cC`sng}xag|jdi�D]*}|t|jdi��kr|^qD]}|jdj|��qJW|S(s� The command generator when state is deleted

        :rtype: A list
        :returns: the commands necessary to remove the current configuration
                  of the provided objects
        R;sno lacp system {0}(RRR>R7(R.R/Rtktx((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR8�sJ(t__name__t
__module__t__doc__RRR
RR*R"R-tstaticmethodR:R9R8(((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyR
s							N(RGt
__future__RRRttypet
__metaclass__t,ansible.module_utils.network.common.cfg.baseRt)ansible.module_utils.network.common.utilsRt.ansible.module_utils.network.iosxr.facts.factsRRtansible.module_utils.sixRRt.ansible.module_utils.network.iosxr.utils.utilsR	R
(((sW/usr/lib/python2.7/site-packages/ansible/module_utils/network/iosxr/config/lacp/lacp.pyt<module>s

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