Anons79 Mini Shell

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

�
�Udac@`s�dZddlmZmZmZeZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZydd	lmZeZWnek
r�eZnXd
efd��YZdS(
s�
The junos 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(tdeepcopy(tto_bytes(tutils(t	VlansArgs(tget_resource_config(tstring_types(tetreet
VlansFactscB`s2eZdZddd�Zdd�Zd�ZRS(s  The junos vlans 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((sX/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/vlans/vlans.pyt__init__!s	
cC`sCts|jjdd�n|s=d}t|d|�}nt|t�rjtjt|dd��}n|j	d�}g}xH|D]@}|dk	r�|j|j|�}|r�|j
|�q�q�q�Wi}	|r.g|	d<tj|ji|d	6�}
x/|
d	D] }|	dj
tj|��qWn|d
j|	�|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
        tmsgslxml is not installed.s�
                <configuration>
                  <vlans>
                  </vlans>
                </configuration>
                t
config_filterterrorstsurrogate_then_replacesconfiguration/vlans/vlantvlansRtansible_network_resourcesN(tHAS_LXMLR
t	fail_jsonRt
isinstanceRR	t
fromstringRtxpathtNonet
render_configRtappendRtvalidate_configRtremove_emptiestupdate(Rt
connectiont
ansible_factstdataRt	resourcestobjstresourcetobjtfactstparamstcfg((sX/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/vlans/vlans.pytpopulate_facts/s0

!cC`s[t|�}tj|d�|d<tj|d�|d<tj|d�|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
        tnamesvlan-idtvlan_idtdescription(RRtget_xml_conf_argR&(RRtconfR((sX/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/vlans/vlans.pyR#Ys

N(t__name__t
__module__t__doc__RR"R2R#(((sX/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/vlans/vlans.pyR
s*N(R:t
__future__RRRttypet
__metaclass__tcopyRtansible.module_utils._textRt#ansible.module_utils.network.commonRt6ansible.module_utils.network.junos.argspec.vlans.vlansRt.ansible.module_utils.network.junos.utils.utilsRtansible.module_utils.sixRtlxmlR	tTrueRtImportErrortFalsetobjectR
(((sX/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/vlans/vlans.pyt<module>s




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