Anons79 Mini Shell

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

�
�Udac@`s�dZddlmZmZmZeZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZydd	lmZeZWnek
r�eZnXd
efd��YZdS(
s�
The junos interfaces 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(tInterfacesArgs(tget_resource_config(tstring_types(tetreetInterfacesFactscB`s2eZdZddd�Zdd�Zd�ZRS(s% The junos interfaces 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((sb/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/interfaces/interfaces.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 interfaces

        :param connection: the device connection
        :param data: previously collected configuration as lxml ElementTree root instance
                     or valid xml sting
        :rtype: dictionary
        :returns: facts
        tmsgslxml is not installed.sp
                <configuration>
                    <interfaces/>
                </configuration>
            t
config_filterterrorstsurrogate_then_replaces"configuration/interfaces/interfacet
interfacesRtansible_network_resourcesN(tHAS_LXMLR
t	fail_jsonRt
isinstanceRR	t
fromstringRtxpathtNonet
render_configRtappendRtvalidate_configRtremove_emptiestupdate(Rt
connectiont
ansible_factstdataRt	resourcestobjstresourcetobjtfactstparamstcfg((sb/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/interfaces/interfaces.pytpopulate_facts.s,	

!cC`st|�}tj|d�|d<tj|d�|d<tj|d�}|r\t|�nd|d<tj|d�|d<tj|d�|d<tj|d�|dd	<tj|d
�|dd<tj|dd
d�}|r�t|d<n
t|d<tj|�S(s4
        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 ElementTree instance of configuration object
        :rtype: dictionary
        :returns: The generated config
        tnametdescriptiontmtutspeeds	link-modetduplexshold-time/downt	hold_timetdownshold-time/uptuptdisableR*ttagtenabledN(RRtget_xml_conf_argtintR"tFalsetTrueR&(RRtconfRR5R;((sb/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/interfaces/interfaces.pyR#Ws


N(t__name__t
__module__t__doc__RR"R2R#(((sb/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/interfaces/interfaces.pyR
s)N(REt
__future__RRRttypet
__metaclass__tcopyRtansible.module_utils._textRt#ansible.module_utils.network.commonRt@ansible.module_utils.network.junos.argspec.interfaces.interfacesRt.ansible.module_utils.network.junos.utils.utilsRtansible.module_utils.sixRtlxmlR	RARtImportErrorR@tobjectR
(((sb/usr/lib/python2.7/site-packages/ansible/module_utils/network/junos/facts/interfaces/interfaces.pyt<module>s




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