Anons79 Mini Shell

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

�
�Udac@`s�dZddlmZmZmZeZddlmZddl	m
Z
mZmZm
Z
mZddlmZddlmZddlmZmZdefd	��YZd
S(s�
The junos_lldp 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(t
locked_configtload_configtcommit_configurationtdiscard_changesttostring(tto_list(tFacts(tbuild_root_xml_nodetbuild_child_xml_nodetLldp_globalcB`skeZdZddgZdgZd�Zd�Zd�Zd�Zd�Z	d	�Z
d
�Zd�ZRS(s
    The junos_lldp class
    s!alls!mintlldp_globalcC`stt|�j|�dS(N(tsuperR
t__init__(tselftmodule((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.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(R
t_modulet	get_factst
gather_subsettgather_network_resourcestget(Rtfactst	_warningst
lldp_facts((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pytget_lldp_global_facts(s
'c	C`sitd6}|j�}|j|�}t|j���x)t|�D]}t|j|g�}qEW|jj}|r�|r�t|j�n
t	|j�t
|d<|jjr�i|d6|d<q�nWdQX||d<|j�}||d<|dr||d<n|S(sl Execute the module
        :rtype: A dictionary
        :returns: The result from module execution
        tchangedtpreparedtdiffNtcommandstbeforetafter(tFalseRt
set_configRRR	Rt
check_modeRRtTruet_diff(Rtresulttexisting_lldp_global_factstconfig_xmlst
config_xmlRtcommittchanged_lldp_global_facts((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pytexecute_module3s(







cC`s2|jjd}|}|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(Rtparamst	set_stateR	(RR)twantthavetresp((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR$VscC`s�td�}|jjd}|dkr=|j||�}nB|dkr^|j||�}n!|dkr|j||�}nx|D]}|j|�q�Wt|�S(se 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 list xml configuration necessary to migrate the current configuration
                  to the desired configuration
        t	protocolststatetdeletedtmergedtreplaced(RRR0t_state_deletedt
_state_mergedt_state_replacedtappendR(RR2R3trootR6R*txml((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR1bs
cC`s<g}|j|j||��|j|j||��|S(s� The xml configuration generator when state is merged
         :rtype: A list
         :returns: the xml configuration necessary to merge the provided into
                   the current configuration
         (textendR:R;(RR2R3tlldp_xml((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR<wscC`s)g}td�}|jd�r8t|d|d�n|jd�r^t|d|d�n|jd�r�t|d|d�n|jd�r�t|d	|d�n|jd
�}|d
k	r�|tkr�t|d�qt|dd
idd6�nt|dd
idd6�|j|�|S(se 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 list xml configuration necessary to migrate the current configuration
                  to the desired configuration
        tlldptaddresssmanagement-addresstintervalsadvertisement-intervalttransmit_delaystransmit-delaythold_multipliershold-multipliertenabletdisabletdeleteN(RRRtNoneR#R=(RR2R3RAt	lldp_rootRG((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR;�s$
cC`s�g}td�}t|ddidd6�t|ddidd6�t|ddidd6�t|ddidd6�t|ddidd6�|j|�|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
        RBsmanagement-addressRIsadvertisement-intervalstransmit-delayshold-multiplierRHN(RRRJR=(RR2R3RARK((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR:�s
(
t__name__t
__module__t__doc__RRRRR.R$R1R<R;R:(((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyR
s					#				N(RNt
__future__RRRttypet
__metaclass__t,ansible.module_utils.network.common.cfg.baseRt(ansible.module_utils.network.junos.junosRRRRRt)ansible.module_utils.network.common.utilsR	t.ansible.module_utils.network.junos.facts.factsR
t+ansible.module_utils.network.common.netconfRRR
(((se/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/config/lldp_global/lldp_global.pyt<module>s(

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