Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyc

�
�Udac@`s�dZddlmZmZmZeZddlmZddl	Z	ddl
mZddlm
Z
defd��YZd	�ZdS(
s�
The eos vlans 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(tdeepcopyN(tutils(t	VlansArgst
VlansFactscB`s2eZdZddd�Zdd�Zd�ZRS(s The eos vlans fact class
    tconfigtoptionscC`sj||_tj|_t|j�}|rN|rA|||}qT||}n|}tj|�|_dS(N(t_moduleRt
argument_specRRt
generate_dicttgenerated_spec(tselftmoduletsubspecRtspectfacts_argument_spec((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyt__init__s	
cC`s(|s|jd�}nd}d||f}gtj||tj�D]}|j�^qG}g}xB|D]:}	|	rl|j|j|	�}
|
r�|j|
�q�qlqlW|djdd�i}|rt
j|ji|d6�}g|dD]}
t
j
|
�^q�|d<n|dj|�|S(s� Populate the facts for vlans
        :param connection: the device connection
        :param ansible_facts: Facts dictionary
        :param data: previously collected conf
        :rtype: dictionary
        :returns: facts
        s#show running-config | section ^vlantvlans(?:^|\n)%s.*?(?=(?:^|\n)%s|$)tansible_network_resourcestvlansRN(tgettretfindalltDOTALLtstript
render_configRtextendtpoptNoneRtvalidate_configR
tremove_emptiestupdate(R
t
connectiont
ansible_factstdatatresource_delimtfind_patterntpt	resourcestobjstresourcetobjtfactstparamstcfg((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pytpopulate_facts(s*
"
-cC`s�t|�}g}ttj|d��}xZ|D]R}||d<tj|d�|d<tj|d�|d<|jtj|��q1W|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
        Rtvlan_idtnametstate(Rtvlan_to_listRtparse_conf_argtappendR (R
RtconfRRt	vlan_listR((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyRKs


N(t__name__t
__module__t__doc__RRR/R(((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyRs#cC`s�g}xt|jd�D]c}d|krf|jd�\}}|jtt|�t|�d��q|jt|��qW|S(Nt,t-i(tsplitRtrangetintR5(tvlan_strRRtstarttstop((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyR3cs)(R:t
__future__RRRttypet
__metaclass__tcopyRRt#ansible.module_utils.network.commonRt4ansible.module_utils.network.eos.argspec.vlans.vlansRtobjectRR3(((sV/usr/lib/python2.7/site-packages/ansible/module_utils/network/eos/facts/vlans/vlans.pyt<module>
sM

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