Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyo

�
�Udac@`s�dZddlmZmZmZeZddlmZm	Z	ddl
mZddlm
Z
ddlmZdefd��YZd	S(
s�
The vyos lldp_global fact class
It is in this file the configuration is collected from the device
for a given resource, parsed, and the facts tree is populated
based on the configuration.
i(tabsolute_importtdivisiontprint_function(tfindalltM(tdeepcopy(tutils(tLldp_globalArgstLldp_globalFactscB`sDeZdZddd�Zdd�Zd�Zd�Zd�ZRS(	s% The vyos lldp_global fact class
    tconfigtoptionscC`sj||_tj|_t|j�}|rN|rA|||}qT||}n|}tj|�|_dS(N(t_moduleRt
argument_specRRt
generate_dicttgenerated_spec(tselftmoduletsubspecR
tspectfacts_argument_spec((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyt__init__s	
cC`s|s|j�}ni}td|t�}|r�xXt|�D]G}d|}t||t�}|j|�}	|	r@|j|	�q@q@Wntd|t�}
|
s�|r�i}t|d<|j|�ni}tj|j	i|d6�}
tj
|
d�|d<|dj|�|S(s� Populate the facts for lldp_global
        :param connection: the device connection
        :param ansible_facts: Facts dictionary
        :param data: previously collected conf
        :rtype: dictionary
        :returns: facts
        s^set service lldp (\S+)s %s .+$s^set service (lldp)?('lldp')tenableR	tlldp_globaltansible_network_resources(t
get_configRRtsett
render_configtupdatetTrueRtvalidate_configRtremove_empties(Rt
connectiont
ansible_factstdatatobjstlldp_outputtitemt
lldp_regextcfgtobjtlldp_servicetlldp_objtfactstparams((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pytpopulate_facts(s*

cC`sndjtd�|��}djtd�|��}|jddg|�}|j|�|d<tj|�S(s
         Render config as dictionary structure and delete keys
           from spec for null values
         :param spec: The facts tree, generated from the argspec
         :param conf: The configuration
         :rtype: dictionary
         :returns: The generated config
         s
cS`s
d|kS(Nslegacy-protocols((tx((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyt<lambda>SscS`s
d|kS(Nslegacy-protocols((R-((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyR.Tstsnmptaddresstlegacy_protocols(tjointfiltert
parse_attribstparse_protocolsRR(Rtconft
protocol_conftatt_confR	((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyRJs	cC`s[d}|rWtd|t�}|rWg}x'|D]}|j|jd��q1WqWn|S(Ns^.*legacy-protocols (.+)t'(tNoneRRtappendtstrip(RR6tprotocol_supportt	protocolstprotocol((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyR5[s
 cC`s\i}xF|D]>}tj||�}|rA|jd�||<q
d||<q
Wtj|�S(NR9(Rtparse_conf_argR<R:R(RtattribsR6R	R$tvalue((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyR4es
N(	t__name__t
__module__t__doc__RR:R,RR5R4(((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyRs"		
N(REt
__future__RRRttypet
__metaclass__treRRtcopyRt#ansible.module_utils.network.commonRtAansible.module_utils.network.vyos.argspec.lldp_global.lldp_globalRtobjectR(((sc/usr/lib/python2.7/site-packages/ansible/module_utils/network/vyos/facts/lldp_global/lldp_global.pyt<module>s

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