HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/junos.cpython-310.pyc
o

�N�g�&�@sdZddlZddlZddlZddlZddlZddlmZddlZddl	Z
ddlZ
ddlZ
ddl
Z
ddlZ
ddlZ
zddlmZWneyRddlmmZYnwzSddlZddlmmZddlZddlZddlZddlmZddl m!Z!m"Z"m#Z#m$Z$ddl%m&Z&ddl'm(Z(dd	l)m*Z*dd
l+m,Z,ddl-m.Z.ddl/m0Z0d
Z1Wney�dZ1Ynwe�2e3�Z4dZ5dgZ6dd�Z7Gdd�d�Z8dd�Z9dd�Z:dd�Z;e:dd��Z<dd�Z=e9dRdd��Z>e9dSd d!��Z?e9d"d#��Z@e9d$d%��ZAe9d&d'��ZBe9dSd(d)��ZCe9dSd*d+��ZDe9d,d-��ZEe9dSd.d/��ZFe:d0d1��ZGe9dSd2d3��ZHe:d4d5��ZIe:d6d7��ZJe:d8d9��ZKe9dSd:d;��ZLe:d<d=��ZMe:						dTd>d?��ZNd@dA�ZOe9dBdC��ZPdDdE�ZQdFdG�ZRe9dHdI��ZSe9dJdK��ZTdLdM�ZUe9dNdO��ZVe9dUdPdQ��ZWdS)VaE
Module to interact with Junos devices.

:maturity: new
:dependencies: junos-eznc, jxmlease

.. note::

    Those who wish to use junos-eznc (PyEZ) version >= 2.1.0, must
    use the latest salt code from github until the next release.

Refer to :mod:`junos <salt.proxy.junos>` for information on connecting to junos proxy.

�N��wraps)�etree)�Device)�ConnectClosedError�	LockError�RpcTimeoutError�UnlockError)�CfgTable)�
FactoryLoader)�OpTable)�Config)�SCP)�SWTF�junoscCstrdtvrtSdS)z�
    We need the Junos adapter libraries for this
    module to work.  We also need a proxymodule entry in __opts__
    in the opts dictionary
    �proxy)Fz�The junos or dependent module could not be loaded: junos-eznc or jxmlease or yamlordereddictloader or proxy could not be loaded.)�	HAS_JUNOS�__opts__�__virtualname__�rr�F/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/junos.py�__virtual__Ksrc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�HandleFileCopyz�
    To figure out proper path either from proxy local file system
    or proxy cache or on master. If required, then only copy from
    master to proxy

    cKs||_d|_d|_||_dS�N)�
_file_path�_cached_folder�_cached_file�_kwargs)�self�path�kwargsrrr�__init__ds
zHandleFileCopy.__init__cCst|j�d�rytd|j�}|rZtd|j�}td|�}|�d�|krZtjj��|_tjj�	|jd��}tdd
|dd	�|j
��}|�|�Wd�|jS1sRwY|jStjj��|_td
|j|jfi|j
��|jdkrw|jSdStd|j�r�tjj��|_tjj�	|jd��}tdd
|jdd	�|j
��}|�|�Wd�|jS1s�wY|jSdS)Nzsalt://zcp.is_cachedzcp.hash_filez
file.get_hashZhsum�wzslsutil.rendererZjinja)rZdefault_rendererzcp.get_template�zfile.file_existsr)r�
startswith�__salt__�get�salt�utils�filesZmkstempr�fopenr�write)rZlocal_cache_pathZmaster_hashZ
proxy_hash�fpZtemplate_stringrrr�	__enter__jsT��
����
���
���zHandleFileCopy.__enter__cCsV|jdurtjj�|j�t�d|j�|jdur)td|j�t�d|j�dSdS)NzDeleted cached file: %sz
file.rmdirzDeleted cached folder: %s)	rr'r(r)Zsafe_rm�log�debugrr%)r�exc_type�	exc_value�
exc_tracebackrrr�__exit__�s

�zHandleFileCopy.__exit__N)�__name__�
__module__�__qualname__�__doc__r!r-r3rrrrr\s
&rc�t���fdd��}|S)Ncs�d|vsd|vr9t|�dd�|�dd��}td�}|j}||_z
�|i|��}||_|WSty8||_�w�|i|��S)N�dev_timeout�timeoutr�
junos.conn)�max�pop�	__proxy__r:�	Exception)�argsr �ldev_timeout�conn�restore_timeout�result��functionrr�wrapper�s
�z#_timeout_decorator.<locals>.wrapperr�rFrGrrEr�_timeout_decorator�srIcr8)Ncs@d|vsd|vrht|�dd�|�dd��}td�}|j}||_z<d}g}i}|�|�|D]}|�d�r:|�|�q.|rId}|D]}	|�|	�qA�|i|��}
|rW|�|�||_|
WStyg||_�wd}g}i}|�|�|D]}|�d�r�|�|�qu|r�d}|D]}	|�|	�q��|i|��}|r�|�|�|S)Nr9r:rr;FZ__pubT)r<r=r>r:�updater$�appendr?)r@r rArBrCZrestore_kwargsZdel_list�opZkeychkZdelkeyrD�retrErrrG�sV



�
�


�
z/_timeout_decorator_cleankwargs.<locals>.wrapperrrHrrEr�_timeout_decorator_cleankwargs�s/rNcCsht�dd�pt�dd�}t�d|�tdid�tdd��td	t�td
t�t�d|�dS)NZproxyidr#�idz>Junos exception occurred %s (junos proxy) is down. Restarting.zevent.fire_masterzjunos/proxy/{}/stopr�hostzjunos.shutdownz
junos.initz5Junos exception occurred, restarted %s (junos proxy)!)rr&r.�infor%�formatr>r/)Z	minion_idrrr�_restart_connection�s��rSc
Cs�td�}i}d|d<z|��Wn#ty4}zd|�d�|d<d|d<t�|WYd}~Sd}~wwtd	�|d
<ztd�W|Sty]}z
t�d|�WYd}~|Sd}~ww)
a0
    Reload the facts dictionary from the device. Usually only needed if,
    the device configuration is changed by some other actor.
    This function will also refresh the facts stored in the salt grains.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.facts_refresh
    r;T�out�Execution failed due to "�"�messageFN�junos.get_serialized_facts�factszsaltutil.sync_grainsz'Grains could not be updated due to "%s")r>�
facts_refreshr?rSr%r.�error�rBrM�	exceptionrrrrZ�s*

�����rZc
Csfi}ztd�|d<d|d<W|Sty2}zd|�d�|d<d|d<t�WYd	}~|Sd	}~ww)
z�
    Displays the facts gathered during the connection.
    These facts are also stored in Salt grains.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.facts
    rXrYTrTz Could not display facts due to "rVrWFN)r>r?rS)rMr]rrrrYs
���rYc
Kstd�}i}d|d<t�}d|vr)|dr(t|ddt�r(|�|dd�nd|vr@|��D]
\}}|�d�s>|||<q1n|�|�|durSd	|d
<d|d<|S|�dd
�}|�d|�|dvr�d}	d|vr�z	t�|d�}	Wn"tj	y�}
zdt
|
���|d
<d|d<|WYd}
~
Sd}
~
ww|d=|�d|i�zt|j|�
dd��|	|d�}Wnoty�}zd|�d�|d
<d|d<t�|WYd}~Sd}~wwd|vr�t�d�d|vr�t�d|�zt|j|�
dd��d|ifi|��}Wn$t�y}zd|�d�|d
<d|d<t�|WYd}~Sd}~ww|dk�r*|j|d<n|dk�r4||d<n
t�t�|��|d<|�r�|dk�rJ|j}
n|dk�rYtjjj|dd�}
nt�|�}
tjj�|d��}|�tjj�|
��Wd�|S1�s}wY|S)aA
    This function executes the RPC provided as arguments on the junos device.
    The returned data can be stored in a file.

    cmd
        The RPC to be executed

    dest
        Destination file where the RPC output is stored. Note that the file
        will be stored on the proxy minion. To push the files to the master use
        :py:func:`cp.push <salt.modules.cp.push>`.

    format : xml
        The format in which the RPC reply is received from the device

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    filter
        Used with the ``get-config`` RPC to get specific configuration

    terse : False
        Amount of information you want

    interface_name
      Name of the interface to query

    CLI Example:

    .. code-block:: bash

        salt 'device' junos.rpc get_config dest=/var/log/config.txt format=text filter='<configuration><system/></configuration>'
        salt 'device' junos.rpc get-interface-information dest=/home/user/interface.xml interface_name='lo0' terse=True
        salt 'device' junos.rpc get-chassis-inventory
    r;TrT�	__pub_arg���Z__pub_scheduleZ__pub_Nz"Please provide the rpc to execute.rWFrR�xml�dest)z
get-configZ
get_config�filterzInvalid filter: �-�_)�optionszRPC execution failed due to "rVz7Filter ignored as it is only used with "get-config" rpcz,dest in op, rpc may reject this for cmd '%s'�textZ	rpc_reply�json�)�indentr")r>�dict�
isinstancerJ�itemsr$r=rZXMLZXMLSyntaxError�str�getattr�rpc�replacer?rSr.�warningrf�jxmlease�parse�tostringr'r(rg�dumpsr)r*r+�stringutils�to_str)�cmdrar rBrMrL�key�value�format_Zfilter_reply�ex�replyr]Zwrite_responser,rrrro(s�
%�
��
�� ��
(��






��roc
Kstd�}i}|durd|d<d|d<|St�}d|vr3|dr2t|ddt�r2|�|dd�n|�|�d	|��}z
|jj|d
d�Wn"tyi}zd�|�|d<d|d<t�|WYd}~Sd}~wwz|j�	�}Wn#ty�}zd
|�d�|d<d|d<t�|WYd}~Sd}~ww|r�z|jj
di|��d|d<d|d<W|Sty�}zd|d<d�|�|d<t�|WYd}~Sd}~wwd|d<d|d<z|j��W|Sty�}zd|d<d�|�|d<t�WYd}~|Sd}~ww)a�
    Set the device's hostname

    hostname
        The name to be set

    comment
        Provide a comment to the commit

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    confirm
      Provide time in minutes for commit confirmation. If this option is
      specified, the commit will be rolled back in the specified amount of time
      unless the commit is confirmed.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.set_hostname salt-device
    r;NzPlease provide the hostname.rWFrTr^r_zset system host-name �set)rRz.Could not load configuration due to error "{}"z%Could not commit check due to error "rVzSuccessfully changed hostname.Tz9Successfully loaded host-name but commit failed with "{}"z:Successfully loaded host-name but pre-commit check failed.zBSuccessfully loaded host-name but rollback before exit failed "{}"r)r>rjrkrJ�cu�loadr?rRrS�commit_check�commit�rollback)�hostnamer rBrMrLZ
set_stringr]�	commit_okrrr�set_hostname�s�
�

�����
�����

�����r�c
Ks�td�}i}t�}d|vr%|dr$t|ddt�r$|�|dd�n|�|�|�dd�|d<z|j��}Wn#ty\}zd|�d�|d<d|d	<t�|WYd
}~Sd
}~ww|r�z4|jj	di|��}d|d	<|r�|dr~t
�t�
|��|d<nd|d<nd
|d<d|d	<W|SW|SW|Sty�}zd|d	<d�|�|d<t�WYd
}~|Sd
}~wwd|d	<d|d<z|j��W|Sty�}zd|d	<d�|�|d<t�WYd
}~|Sd
}~ww)a�
    To commit the changes loaded in the candidate configuration.

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    comment
      Provide a comment for the commit

    confirm
      Provide time in minutes for commit confirmation. If this option is
      specified, the commit will be rolled back in the specified amount of time
      unless the commit is confirmed.

    sync : False
      When ``True``, on dual control plane systems, requests that the candidate
      configuration on one control plane be copied to the other control plane,
      checked for correct syntax, and committed on both Routing Engines.

    force_sync : False
      When ``True``, on dual control plane systems, force the candidate
      configuration on one control plane to be copied to the other control
      plane.

    full
      When ``True``, requires all the daemons to check and evaluate the new
      configuration.

    detail
      When ``True``, return commit detail

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.commit comment='Commiting via saltstack' detail=True
        salt 'device_name' junos.commit dev_timeout=60 confirm=10
        salt 'device_name' junos.commit sync=True dev_timeout=90
    r;r^r_ZdetailFz'Could not perform commit check due to "rVrWrTNTzCommit Successful.zCommit failed.z9Commit check succeeded but actual commit failed with "{}"zPre-commit check failed.z;Pre-commit check failed, and exception during rollback "{}"r)r>rjrkrJr&rr�r?rSr�rrrsrrtrRr�)r rBrMrLr�r]r�rrrr��sv
*�
��

�������	
�����r�c

Kspd}d}d|vr|�d�}|d}d|vr|�dd�}|d}|dkr(t�d�i}td�}t�}d|vrM|drLt|ddt�rL|�|dd�n|�|�z
|j�|�|d	<Wn#t	y}zd
|�d�|d<d
|d	<t
�|WYd}~Sd}~ww|d	r�d|d<nd|d<|Sd|vr�|ddur�|j��}|dur�tj
j�|dd��}|�tj
j�|��Wd�n1s�wYnt�d�z|j��}	Wn#t	y�}zd|�d�|d<d
|d	<t
�|WYd}~Sd}~ww|	�r.z|jjdi|��d|d	<W|St	�y-}zd
|d	<d�|�|d<t
�|WYd}~Sd}~wwd|d<d
|d	<|S)a
    Roll back the last committed configuration changes and commit

    id : 0
        The rollback ID value (0-49)

    d_id : 0
        The rollback ID value (0-49)

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    comment
      Provide a comment for the commit

    confirm
      Provide time in minutes for commit confirmation. If this option is
      specified, the commit will be rolled back in the specified amount of time
      unless the commit is confirmed.

    diffs_file
      Path to the file where the diff (difference in old configuration and the
      committed configuration) will be stored. Note that the file will be
      stored on the proxy minion. To push the files to the master use
      :py:func:`cp.push <salt.modules.cp.push>`.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.rollback 10

    NOTE: Because of historical reasons and the internals of the Salt state
    compiler, there are three possible sources of the rollback ID--the
    positional argument, and the `id` and `d_id` kwargs.  The precedence of
    the arguments are `id` (positional), `id` (kwarg), `d_id` (kwarg).  In
    other words, if all three are passed, only the positional argument
    will be used.  A warning is logged if more than one is passed.
    r�d_idrhrO�ujunos.rollback called with more than one possible ID. Use only one of the positional argument, `id`, or `d_id` kwargsr;r^r_rTzRollback failed due to "rVrWFNzRollback successfulzRollback failed�
diffs_filer"z[No diff between current configuration and rollbacked configuration, so no diff file createdzCould not commit check due to "Tz5Rollback successful but commit failed with error "{}"z0Rollback successful but pre-commit check failed.r)r=r.rqr>rjrkrJrr�r?rS�diffr'r(r)r*r+rvrwrQr�r�rR)
r �
ids_passed�id_rMrBrLr]r�r,r�rrrr�]s�)
�
�
��

�����
�����
r�c
Ks�tjjjdi|��}d}d}d|vr|�d�}|d}d|vr)|�dd�}|d}|dkr2t�d�|r;tjj�|�td�}i}d|d<z|j	j
|d	�|d
<W|Styt}zd|�d�|d
<d
|d<t�WYd}~|Sd}~ww)a�
    Returns the difference between the candidate and the current configuration

    id : 0
        The rollback ID value (0-49)

    d_id : 0
        The rollback ID value (0-49)

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.diff d_id=3

    NOTE: Because of historical reasons and the internals of the Salt state
    compiler, there are three possible sources of the rollback ID--the
    positional argument, and the `id` and `d_id` kwargs.  The precedence of
    the arguments are `id` (positional), `id` (kwarg), `d_id` (kwarg).  In
    other words, if all three are passed, only the positional argument
    will be used.  A warning is logged if more than one is passed.
    rr�rhrOr�r;TrT)Zrb_idrWzCould not get diff with error "rVFNr)
r'r(r@�clean_kwargsr=r.rqZinvalid_kwargsr>rr�r?rS)r r�r�rBrMr]rrrr��s8
�
���r�c
Kstd�}i}|durd|d<d|d<|Sd|i}d|vr4|dr3t|dd	t�r3|�|dd	�n|�|�t|�d
d��|d
<d|vrOt|d�|d<d
|d<zt�t�	|j
jdi|����|d<W|Sty�}zd|�d�|d<d|d<t
�WYd}~|Sd}~ww)a�
    Send a ping RPC to a device

    dest_ip
      The IP of the device to ping

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    rapid : False
        When ``True``, executes ping at 100pps instead of 1pps

    ttl
        Maximum number of IP routers (IP hops) allowed between source and
        destination

    routing_instance
      Name of the routing instance to use to send the ping

    interface
      Interface used to send traffic

    count : 5
      Number of packets to send

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.ping '8.8.8.8' count=5
        salt 'device_name' junos.ping '8.8.8.8' ttl=1 rapid=True
    r;Nz*Please specify the destination ip to ping.rWFrTrPr^r_�count�ZttlTrUrVr)r>rkrjrJrmr=rrrsrrtro�pingr?rS)Zdest_ipr rBrMrLr]rrrr�s6
"�
$���r�c	
Ks�td�}|�dd�}|sd}i}|durd|d<d|d<|St�}d	|vr=|d	r<t|d	d
t�r<|�|d	d
�n|�|�z
|j||dd�}Wn#tyo}zd|�d
�|d<d|d<t�|WYd}~Sd}~ww|dkry||d<nt�	|�}t
�|�|d<d|vr�|ddur�z&tj
j�|dd��}|�tj
j�|��Wd�n1s�wYWnty�d�|d�|d<d|d<|YSwd|d<|S)a
    Executes the CLI commands and returns the output in specified format.     (default is text) The output can also be stored in a file.

    command (required)
        The command to execute on the Junos CLI

    format : text
        Format in which to get the CLI output (either ``text`` or ``xml``)

    dev_timeout : 30
        The NETCONF RPC timeout (in seconds)

    dest
        Destination file where the RPC output is stored. Note that the file
        will be stored on the proxy minion. To push the files to the master use
        :py:func:`cp.push <salt.modules.cp.push>`.

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.cli 'show system commit'
        salt 'device_name' junos.cli 'show system alarms' format=xml dest=/home/user/cli_output.txt
    r;rRrfNz.Please provide the CLI command to be executed.rWFrTr^r_)rqrUrVrar"zUnable to open "{}" to writeT)r>r=rjrkrJ�clir?rSrrtrrrsr'r(r)r*r+rvrw�OSErrorrR)	�commandr rBr{rMrLrDr]r,rrrr�MsT
�
��

���r�c
KsVtd�}i}t|�}i}d|vr(|dr't|ddt�r'|�|dd�n|�|�d|vr?d|vr?d|d<d|d	<|SzId|vrL|drL|j}nd|vrX|drX|j}nd
|d<d|d	<|WSd|vro||dd�nd
|vr{||d
d�n|�d|d<d|d	<W|Sty�}zd|�d�|d<d|d	<t�WYd}~|Sd}~ww)a
    Shut down (power off) or reboot a device running Junos OS. This includes
    all Routing Engines in a Virtual Chassis or a dual Routing Engine system.

      .. note::
          One of ``shutdown`` or ``reboot`` must be set to ``True`` or no
          action will be taken.

    shutdown : False
      Set this to ``True`` if you want to shutdown the machine. This is a
      safety mechanism so that the user does not accidentally shutdown the
      junos device.

    reboot : False
      If ``True``, reboot instead of shutting down

    at
      Used when rebooting, to specify the date and time the reboot should take
      place. The value of this option must match the JunOS CLI reboot syntax.

    in_min
        Used when shutting down. Specify the delay (in minutes) before the
        device will be shut down.

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.shutdown reboot=True
        salt 'device_name' junos.shutdown shutdown=True in_min=10
        salt 'device_name' junos.shutdown shutdown=True
    r;r^r_�shutdown�rebootz8Provide either one of the arguments: shutdown or reboot.rWFrTzNothing to be done.�in_min)r��at)r�z"Successfully powered off/rebooted.Tz#Could not poweroff/reboot because "rVN)	r>rrkrjrJr�Zpoweroffr?rS)r rBrM�swrLZshutr]rrrr��sJ
"�

���r�cKs<td�}i}d|d<|durd|d<d|d<|Si}d|vr6|dr5t|dd	t�r5|�|dd	�n|�|�|�d
d�}i}d|vrP|�d|di�t|fi|����:}|durod|d<d|d<|Wd�Stj�|�d
kr�d|d<d|d<|Wd�Sd}d|vr�|ddur�|d}|d=||d<d|vr�|�	d�r�d}n|�	d�r�d}n
|�	d�r�d}nd}||d<d|vr�|dr�d|d<|d=nd|vr�|dr�d|d<nd|vr�|ds�d|d<|d=|�dd�}	|�r|	dv�rd|d<d|d<|Wd�Si}
d|v�r|�d�|
d<�z�t
|fd|	i|
�����}z
|jd4i|��Wn9t�yk}z,d|�d �|d<|d|d<d|d<t
�|WYd}~Wd�WWd�Sd}~wwd}
|	dv�ryt�d!�n"|��}
|
du�r�d"|d<d|d<|Wd�WWd�Si}d#|v�r�|d#|d#<d$|v�r�|d$|d$<d}|	dv�r�t�d%�n9z|��}Wn2t�y�}z%d&�|�|d<d|d<t
�|WYd}~Wd�WWd�Sd}~ww|�r@|�s@z|jd4i|��d'|d<Wn�t�y?}z%d(�|�|d<d|d<t
�|WYd}~Wd�WWd�Sd}~ww|�spz
|��d)|d<Wnt�yj}zd*�|�|d<t
�WYd}~nd}~wwd|d<n0z|��d+|d<d|d<Wn!t�y�}zd,�|�|d<d|d<t
�WYd}~nd}~wwz-|�r�|
du�r�tjj�|d-��}|�tjj�|
��Wd�n	1�s�wYWnt�y�}zd.|�d/�|d<d|d<WYd}~nd}~wwWd�n	1�s�wYWn�t�y%}zd0t|���}t�|�||d<d|d<WYd}~nid}~wt�yE}zt�d1�|j |d<d|d<WYd}~nId}~wt!�yk}zd2t|���}t�|�||d<d|d<WYd}~n#d}~wt�y�}zd3|�d/�|d<d|d<WYd}~nd}~ww|Wd�S1�s�wYdS)5a'

    Installs the given configuration file into the candidate configuration.
    Commits the changes if the commit checks or throws an error.

    path (required)
        Path where the configuration/template file is present. If the file has
        a ``.conf`` extension, the content is treated as text format. If the
        file has a ``.xml`` extension, the content is treated as XML format. If
        the file has a ``.set`` extension, the content is treated as Junos OS
        ``set`` commands.

    mode : exclusive
        The mode in which the configuration is locked. Can be one of
        ``private``, ``dynamic``, ``batch``, ``exclusive``, ``ephemeral``

    dev_timeout : 30
        Set NETCONF RPC timeout. Can be used for commands which take a while to
        execute.

    overwrite : False
        Set to ``True`` if you want this file is to completely replace the
        configuration file. Sets action to override

        .. note:: This option cannot be used if **format** is "set".

    replace : False
        Specify whether the configuration file uses ``replace:`` statements. If
        ``True``, only those statements under the ``replace`` tag will be
        changed.

    merge : False
        If set to ``True`` will set the load-config action to merge.
        the default load-config action is 'replace' for xml/json/text config

    format
        Determines the format of the contents

    update : False
        Compare a complete loaded configuration against the candidate
        configuration. For each hierarchy level or configuration object that is
        different in the two configurations, the version in the loaded
        configuration replaces the version in the candidate configuration. When
        the configuration is later committed, only system processes that are
        affected by the changed configuration elements parse the new
        configuration. This action is supported from PyEZ 2.1.

    comment
      Provide a comment for the commit

    confirm
      Provide time in minutes for commit confirmation. If this option is
      specified, the commit will be rolled back in the specified amount of time
      unless the commit is confirmed.

    diffs_file
      Path to the file where the diff (difference in old configuration and the
      committed configuration) will be stored. Note that the file will be
      stored on the proxy minion. To push the files to the master use:

        py:func:`cp.push <salt.modules.cp.push>`.

    template_vars
      Variables to be passed into the template processing engine in addition to
      those present in pillar, the minion configuration, grains, etc.  You may
      reference these variables in your template like so:

      .. code-block:: jinja

          {{ template_vars["var_name"] }}

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.install_config 'salt://production/network/routers/config.set'
        salt 'device_name' junos.install_config 'salt://templates/replace_config.conf' replace=True comment='Committed via SaltStack'
        salt 'device_name' junos.install_config 'salt://my_new_configuration.conf' dev_timeout=300 diffs_file='/salt/confs/old_config.conf' overwrite=True
        salt 'device_name' junos.install_config 'salt://syslog_template.conf' template_vars='{"syslog_host": "10.180.222.7"}'
    r;TrTN�?Please provide the salt path where the configuration is presentrWFr^r_�test�
template_vars�Invalid file path.r�Template failed to renderr#r�rrRr~r`rgrfrp�merge�	overwrite�modeZ	exclusive)ZdynamicZ	ephemeralzEWrite diff is not supported with dynamic/ephemeral configuration modeZephemeral_instancez'Could not load configuration due to : "rVz/diff is not supported for dynamic and ephemeralzConfiguration already applied!ZconfirmZcommentz4commit check not supported for dynamic and ephemeralz0Commit check threw the following exception: "{}"z"Successfully loaded and committed!z3Commit check successful but commit failed with "{}"zOLoaded configuration but commit check failed, hence rolling back configuration.zkLoaded configuration but commit check failed, and exception occurred during rolling back configuration "{}"zTCommit check passed, but skipping commit for dry-run and rolling back configuration.zqCommit check passed, but skipping commit for dry-run and while rolling back configuration exception occurred "{}"r"z)Could not write into diffs_file due to: '�'zinstall_config failed due to: z Configuration database is lockedz-install_config failed due to timeout error : z)install_config failed due to exception: 'r)"r>rkrjrJr=r�osr�getsize�endswithr
r�r?rSr.rqr�r�rRr�r�r'r(r)r*r+rvrw�
ValueErrorrmr[rrWr)rr rBrMrLr��template_cached_pathZ
write_diff�template_formatZdb_modeZ
config_paramsrr]Zconfig_diffZ
commit_params�checkr,r|rW�excrrr�install_config�s�
Q��
��



��/

����6	

��I


�����V
�����d

�����
	�����
��
������h
�

�
����&�r�c
Csttd�}i}d|d<z|�d�d|d<W|Sty9}zd|�d�|d<d	|d<t�WYd
}~|Sd
}~ww)a�
    Resets the device to default factory settings

    .. note::
        In case of non-root user, proxy_reconnect will not be able
        to re-connect to the device as zeroize will delete the local
        user's configuration.
        For more details on zeroize functionality, please refer
        https://www.juniper.net/documentation/en_US/junos/topics/reference/command-summary/request-system-zeroize.html

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.zeroize
    r;TrTzrequest system zeroizezCompleted zeroize and rebootedrWzCould not zeroize due to : "rVFN)r>r�r?rSr\rrr�zeroize�s


���r�cKsntd�}i}d|d<i}d|vr(|dr't|ddt�r'|�|dd�n|�|�t|�dd�|�dd��}td	|j|�}|�d
d�}|�dd�}|d
ur[d|d<d|d<|S|rbtd�d}	|s�t|��}}
|
d
ur�d|d<d|d<td�|Wd
�St	j
j��r�|
}d|d<t
j�|�|d<t
j�|�}
z|jj|
fd|d�|��\}	}Wn/ty�}
z#d|
�d�|d<d|d<td�t�|WYd
}
~
Wd
�Sd
}
~
wwWd
�n1s�wYn;z|jj|fd|d�|��\}	}Wn)t�y*}
zd|
�d�|d<d|d<td�t�|WYd
}
~
Sd
}
~
ww|	du�r9d|d<d|d<nd|��|d<d|d<td�|S|du�r�i}d|v�rc|�d�du�rcd|d<d|v�ro|�d�|d<ztd�|jjdi|��Wn(t�y�}
ztd�d�|
�|d<d|d<t�|WYd
}
~
Sd
}
~
wwtd�d|d<d|d<|S)u\

    Installs the given image on the device. After the installation is complete
    the device is rebooted, if reboot=True is given as a keyworded argument.

    path (required)
        Path where the image file is present on the proxy minion

    remote_path : /var/tmp
        If the value of path  is a file path on the local
        (Salt host's) filesystem, then the image is copied from the local
        filesystem to the :remote_path: directory on the target Junos
        device. The default is ``/var/tmp``. If the value of :path: or
        is a URL, then the value of :remote_path: is unused.

    dev_timeout : 1800
        The NETCONF RPC timeout (in seconds). This argument was added since most of
        the time the "package add" RPC takes a significant amount of time.
        So this :timeout: value will be used in the context of the SW installation
        process.  Defaults to 30 minutes (30*60=1800 seconds)

    timeout : 1800
        Alias to dev_timeout for backward compatibility

    reboot : False
        Whether to reboot after installation

    no_copy : False
        If ``True`` the software package will not be SCP’d to the device

    bool validate:
        When ``True`` this method will perform a config validation against
        the new image

    bool issu: False
        When ``True`` allows unified in-service software upgrade
        (ISSU) feature enables you to upgrade between two different Junos OS
        releases with no disruption on the control plane and with minimal
        disruption of traffic.

    bool nssu: False
        When ``True`` allows nonstop software upgrade (NSSU)
        enables you to upgrade the software running on a Juniper Networks
        EX Series Virtual Chassis or a Juniper Networks EX Series Ethernet
        Switch with redundant Routing Engines with a single command and
        minimal disruption to network traffic.

    bool all_re: True
        When True (default), executes the software install on all Routing Engines of the Junos
        device. When False, execute the software install only on the current Routing Engine.

        .. versionadded:: 3001

    .. note::
        Any additional keyword arguments specified are passed down to PyEZ sw.install() as is.
        Please refer to below URl for PyEZ sw.install() documentation:
        https://pyez.readthedocs.io/en/latest/jnpr.junos.utils.html#jnpr.junos.utils.sw.SW.install

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.install_os 'salt://images/junos_image.tgz' reboot=True
        salt 'device_name' junos.install_os 'salt://junos_16_1.tgz' dev_timeout=300
    r;TrTr^r_r9rr:ir�FZno_copyNz>Please provide the salt path where the junos image is present.rWzjunos.reboot_activez/Invalid path. Please provide a valid image pathzjunos.reboot_clearZremote_path)�progressr:zInstallation failed due to: "rVzInstalled the os.zInstallation failed. Reason: ZvmhostZall_rez7Installation successful but reboot failed due to : "{}"z$Successfully installed and rebooted!r)r>rkrjrJr<r=r:r&rr'r(�platform�is_junosr�r�dirname�basenamer��installr?rSr�rR)rr rBrMrLr9r:r�Zno_copy_Zinstall_statusZ
image_pathZtmp_absfileZinstall_messager]Z
reboot_kwargsrrr�
install_oss�
B�
�


����
��������
��






����
r�cCstjj��rddd�Std�}i}d|d<t|��i}|dur3d|��|d	<d|d<|Wd�Sz(t|dd
��}|�||�Wd�n1sKwYd|�d|��|d	<Wntyy}zd
|�d�|d	<d|d<WYd}~nd}~ww|Wd�S1s�wYdS)a�
    Copies the file from the local device to the junos device

    .. note::
        This function does not work on Juniper native minions

    src
        The source path where the file is kept.

    dest
        The destination path on the where the file will be copied

    .. versionadded:: 3001

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.file_copy /home/m2/info.txt info_copy.txt
    F�;This method is unsupported on the current operating system!��successrWr;TrTNzInvalid source file path rW)r�zSuccessfully copied file from z to zCould not copy file : "rV)	r'r(r�r�r>rr�putr?)�srcrarBrMr,Zscpr]rrr�	file_copy�s2�

����$�r�c
Cs�td�}i}d|d<z|j��d|d<W|Sty9}zd|�d�|d<d|d<t�WYd	}~|Sd	}~wtyW}zd|�d�|d<d|d<WYd	}~|Sd	}~ww)
a�
    Attempts an exclusive lock on the candidate configuration. This
    is a non-blocking call.

    .. note::
        When locking, it is important to remember to call
        :py:func:`junos.unlock <salt.modules.junos.unlock>` once finished. If
        locking during orchestration, remember to include a step in the
        orchestration job to unlock.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.lock
    r;TrTz&Successfully locked the configuration.rWzCould not gain lock due to : "rVFN)r>r�lockrrSrr\rrrr��s&



�����r�c
Cs�td�}i}d|d<z|j��d|d<W|Sty8}zd�|�|d<d|d<t�WYd}~|Sd}~wtyU}zd�|�|d<d|d<WYd}~|Sd}~ww)	z�
    Unlocks the candidate configuration.

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.unlock
    r;TrTz(Successfully unlocked the configuration.rWz,Could not unlock configuration due to : "{}"FN)r>r�unlockrrRrSr	r\rrrr�#s.


�������r�cs�td�}i}d|d<|durd|d<d|d<|Si�d|vr6|dr5t|dd	t�r5��|dd	�n��|�i}d
�vrJ|�d
�d
i�t|fi|����}|durhd|d<d|d<|Wd�Stj�|�dkr�d
|d<d|d<|Wd�S|�d<d�vr�|�d�r�d}n|�d�r�d}n
|�d�r�d}nd}|�d<�fdd�dD�}t	t
|��dkr�d�|�|d<d|d<|Wd�Sd�vr܈dr�d�d<�d=n+d�vr�dr�d�d<nd�vr��dr�d�d<nd�v�r�d�sd�d<�d=z|jj
di���d|d<Wn0t�yF}z#d�|�|d<�d|d<d|d<t�|WYd}~Wd�Sd}~ww|Wd�S1�sTwYdS)a	
    Loads the configuration from the file provided onto the device.

    path (required)
        Path where the configuration/template file is present. If the file has
        a ``.conf`` extension, the content is treated as text format. If the
        file has a ``.xml`` extension, the content is treated as XML format. If
        the file has a ``.set`` extension, the content is treated as Junos OS
        ``set`` commands.

    overwrite : False
        Set to ``True`` if you want this file is to completely replace the
        configuration file. Sets action to override

        .. note:: This option cannot be used if **format** is "set".

    replace : False
        Specify whether the configuration file uses ``replace:`` statements. If
        ``True``, only those statements under the ``replace`` tag will be
        changed.

    merge : False
        If set to ``True`` will set the load-config action to merge.
        the default load-config action is 'replace' for xml/json/text config

    update : False
        Compare a complete loaded configuration against the candidate
        configuration. For each hierarchy level or configuration object that is
        different in the two configurations, the version in the loaded
        configuration replaces the version in the candidate configuration. When
        the configuration is later committed, only system processes that are
        affected by the changed configuration elements parse the new
        configuration. This action is supported from PyEZ 2.1.

    format
        Determines the format of the contents

    template_vars
      Variables to be passed into the template processing engine in addition to
      those present in pillar, the minion configuration, grains, etc.  You may
      reference these variables in your template like so:

      .. code-block:: jinja

          {{ template_vars["var_name"] }}

    CLI Examples:

    .. code-block:: bash

        salt 'device_name' junos.load 'salt://production/network/routers/config.set'

        salt 'device_name' junos.load 'salt://templates/replace_config.conf' replace=True

        salt 'device_name' junos.load 'salt://my_new_configuration.conf' overwrite=True

        salt 'device_name' junos.load 'salt://syslog_template.conf' template_vars='{"syslog_host": "10.180.222.7"}'
    r;TrTNr�rWFr^r_r�r�rr�rrRr~r`rgrfcsg|]
}��|d�r|�qS�F)r&)�.0�item�rLrr�
<listcomp>�s
��zload.<locals>.<listcomp>)r�rprJr�rhz/Only one config_action is allowed. Provided: {}rpr�r�z&Successfully loaded the configuration.z*Could not load configuration due to : "{}"r)r>rkrjrJrr�rr�r��len�listrRrr�r?rS)rr rBrMr�r��actionsr]rr�rr�Ds�
<��
��



���'

���5	&�r�c
Csrtd�}i}d|d<z|j��d|d<W|Sty8}zd|��|d<d|d<t�WYd}~|Sd}~ww)	z�
    Perform a commit check on the configuration

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.commit_check
    r;TrTzCommit check succeeded.rWzCommit check failed with FN)r>rr�r?rSr\rrrr��s


���r�cCs|td�}i}	d|	d<|j|	d<||	d<i}
|dur||
d<|dur&||
d<|dur.||
d	<|dur6||
d
<|durCt|t�rC||
d<tj�tj�tj	��}�z�|dur]tj�
||��}ntj�
||��}t|����}
|
dur�d�|�|	d
<d|	d<|	Wd�WSz1t
jj�|
�� }tj|��tjd�|	d<t��t��|	d��Wd�n1s�wYWn)ty�}zd�t|��|	d
<d|	d<|	WYd}~Wd�WSd}~wwzt�||�}|jdi|
��WnKt�y}zd�t|��|	d
<d|	d<|	WYd}~Wd�WSd}~wt�y;d�|�|	d
<d|	d<t�|	YWd�WSwt� |�!��|	d<|j"j#dt$t%fv�r�|	d|�d�du�re|j&|	d|d<|du�rs|j'|	d|d<|du�r�t(�(|j)�}|�|�||	d|d<nT|du�r�|j*|	d|d<|du�r�|j'|	d|d<|du�r�|j+|	d|d	<|du�r�t(�(|j,�}|�|�||	d|d<|j-|	d|d<Wd�W|	SWd�W|	SWd�W|	S1�s�wYW|	St�yd�t|��|	d
<d|	d<t�|	YSt.�y=}zdt|���|	d
<d|	d<t�|	WYd}~Sd}~ww)a
    .. versionadded:: 3001

    Retrieve data from a Junos device using Tables/Views

    table (required)
        Name of PyEZ Table

    table_file (required)
        YAML file that has the table specified in table parameter

    path:
        Path of location of the YAML file.
        defaults to op directory in jnpr.junos.op

    target:
        if command need to run on FPC, can specify fpc target

    key:
        To overwrite key provided in YAML

    key_items:
        To select only given key items

    filters:
        To select only filter for the dictionary from columns

    table_args:
        key/value pair which should render Jinja template command
        or are passed as args to rpc call in op table

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.get_table RouteTable routes.yml
        salt 'device_name' junos.get_table EthPortTable ethport.yml table_args='{"interface_name": "ge-3/2/2"}'
        salt 'device_name' junos.get_table EthPortTable ethport.yml salt://tables
    r;TrTr�Z	tablenameN�targetry�	key_items�filtersr@z%Given table file {} cannot be locatedrWF)�Loader�tablez7Uncaught exception during YAML Load - please report: {}z:Uncaught exception during get API call - please report: {}z9Got ConnectClosedError exception. Connection lost with {}r}rr�z$Uncaught exception - please report: r)/r>Z	_hostnamerkrjr�rr��abspath�
tables_dir�__file__�joinrrRr'r(r)r*�yamlr��read�yamlordereddictloaderr��globalsrJrr�rmr&�KeyErrorrrSrg�loadsZto_json�	__class__�	__bases__rr
ZITEM_NAME_XPATHZKEY�copyZGET_ARGS�TARGETZ	KEY_ITEMSZCMD_ARGSZGET_CMDr?)r�Z
table_filerr�ryr�r�Z
table_argsrBrMZ
get_kvargsZpyez_tables_pathZ	file_pathZfile_locr,�err�datar@rrr�	get_table�s�
3
��

�������
���� ��� 	


�




�O��O��O�O�����r�cCs�i}|��D]G}d|jvr|j�d�dn|j}|jr$|j��r$|j}nt|�}||vrIt||�tur<||�|�q||�	�}||g||<q|||<q|S)z6
    Convert an lxml.etree node tree into a dict.
    �}rh)
Ziterchildren�tag�splitrf�strip�_recursive_dict�typer�rKr�)�noderD�elementryrzZ	tempvaluerrrr��s 
r�cKsVtjjjdi|��}td�}|jdurdS|jj|d�}i}t|�|d<d|d<|S)	a�
    Use the Junos RPC interface to get a list of files and return
    them as a structure dictionary.

    .. versionadded:: 3003

    CLI Example:

    .. code-block:: bash

        salt junos-router junos.rpc_file_list /var/local/salt/etc

        junos-router:
            files:
                directory:
                    directory-name:
                        /var/local/salt/etc
                    file-information:
                        |_
                          file-directory:
                              file-name:
                                  pki
                        |_
                          file-name:
                              proxy
                        |_
                          file-directory:
                              file-name:
                                  proxy.d
                total-file-blocks:
                    10
                total-files:
                    1
        success:
            True

    r;NF)rr)Tr�r)	r'r(r@r�r>Z_connroZ	file_listr�)rr rB�resultsrMrrr�
rpc_file_list�s'

r�cCs|�dd�}|S)N�
r#)rp)rm�strippedrrr�_strip_newlines�sr�c	Cs�g}|sdSt|�dd}d|vr'd|vrdStj�t|�dd���dgSt|dt�rOtj�|t|dd��}d|dvrLttj�||��}|S|gS|dD])}d|vrnttj�|t|d���}|rm|�	|�qS|�
tj�|t|d���qS|S)	Nr)�	directoryzfile-informationZdirectory_namezdirectory-name�/z	file-namezfile-directory)r�r�rr�r�r&rkrj�_make_source_list�extendrK)�dirZdir_list�baser�Znew_list�entryrrrr��s4��
�r�cKs�tjj��sddd�Sdddd�}tjj�d�}|sddd�Std	|�d
|�d|�d��}|��}|D]$}|��dkrXd|vrLd|d
<d|d<|Sd|d
<d|d<|Sq4d|d
<d|d<|S)a�
    Compare two files and return a dictionary indicating if they
    are different.

    Dictionary includes `success` key.  If False, one or more files do not
    exist or some other error occurred.

    Under the hood, this uses the junos CLI command `file compare files ...`

    .. note::
        This function only works on Juniper native minions

    .. versionadded:: 3003

    CLI Example:

    .. code-block:: bash

        salt junos-router junos.file_compare /var/tmp/backup1/cmt.script /var/tmp/backup2/cmt.script

        junos-router:
            identical:
                False
            success:
                True

    Fr�r�r#T)rW�	identicalr�r��Cannot find Junos cli command�cmd.runz file compare files � zNo such filer�r�)	r'r(r�r�r�whichr%�
splitlinesr�)Zfile1Zfile2r rM�	junos_cliZcliretZclilines�rrrr�file_compares.�
�
r�c	Ks�tjj��sddd�Stjj�d�}|sddd�Std|�d|���}|��}d}d}ddd	�}|D]}d
|vs=d|vrEd|d<d|d
<d|vrQd|d<d|d
<q3|S)a�
    Returns a dictionary indicating if `dir` refers to a file
    or a non-file (generally a directory) in the file system,
    or if there is no file by that name.

    .. note::
        This function only works on Juniper native minions

    .. versionadded:: 3003

    CLI Example:

    .. code-block:: bash

        salt junos-router junos.fsentry_exists /var/log

        junos-router:
            is_dir:
                True
            exists:
                True

    Fr�r�r�r�r�z file show T)�is_dir�existszcould not resolvezerror: Could not connectr�r�zis not a regular file)r'r(r�r�rr�r%r�)	r�r r�rMZretlinesr�r��statusr�rrr�fsentry_existsAs*�

�r�cCs�tjj�d�}|sddd�Std|�d��}d}i}d}d}|��D];}d|vr<t�d	|�}|r<d
t|�	d��d}d
|vrRd|vrFd}d|vrLd}d|vrRd}|r^|r^|||<d}d}q#|sfddd�Sd|d<|S)Nr�Fr�r�r�z show chassis routing-engineTZSlotz
.*(\d+):.*�rerh�:z
Current state�Master�Disabled�Backupz)Junos cli command returned no informationr�)
r'r(rr�r%r�r��searchrm�group)r�Zre_checkZengine_presentZengineZcurrent_enginer��lZmatrrr�_find_routing_enginests>

��rcKs�t�}|dsddiSd}g}|��D]\}}|dkr|}|dks%|dkr*|�|�q|r4||dd�}n||dd�}t�|�|S)	a)
    Returns a dictionary containing the routing engines on the device and
    their status (Master, Disabled, Backup).

    Under the hood parses the result of `show chassis routing-engine`

    .. versionadded:: 3003

    CLI Example:

    .. code-block:: bash

        salt junos-router junos.routing_engine

        junos-router:
            backup:
              - re1:
            master:
              re0:
            success:
              True

    Returns `success: False` if the device does not appear to have multiple routing engines.

    r�FNr�r�r�T)�master�backupr�)rrlrKr.r/)r Z
engine_statusrr�k�vrMrrr�routing_engine�s 
�
rcKs�tjj��sddd�Stjj�d�}|sddd�Si}d}|�d�s,d|d	<d|d
<|S|�d�s@|�d�s@d|d	<d|d
<|St|�}|d
sRd|d	<d|d
<|S|ds`d|d	<d|d
<|St	|�}g}	|D]$}
t
j�|
�d}d}|�d�D]}
t
j�||
�}||	vr�|	�
|�qyqh|	D]&}||}t|�}|d
s�td|�d|���}||}q�|d|d}q�|D]4}
|
�d�s�||
}t|
|�}|dr�|r�td|�d|
�d|���}||}q�|d|
�d|�d�}q�|S)a�
    Copy a directory and recursively its contents from source to dest.

    .. note::
        This function only works on the Juniper native minion

    Parameters:

    source : Directory to use as the source

    dest : Directory in which to place the source and its contents.

    force : This function will not copy identical files unless `force` is `True`

    .. versionadded:: 3003

    CLI Example:

    .. code-block:: bash

        salt 'device_name' junos.dir_copy /etc/salt/pki re1:/

    This will take the `pki` directory, its absolute path and copy it and its
    contents to routing engine 1 root directory. The result will be
    `re1:/etc/salt/pki/<files and dirs in /etc/salt/pki`.

    Fr�r�r�r�r#r�z0Source directory must be a fully qualified path.rWr�r�zUDestination must be a routing engine reference (e.g. re1:) or a fully qualified path.r�zSource does not existr�zSource is not a directory.rr�z file make-directory z
Directory z already exists.
r�z file copy r�zFiles z and z are identical, not copying.
)r'r(r�r�rr�r$r�r�r�r�r�r�rKr%r�)�sourcera�forcer r�rMZret_messages�check_sourceZfilelistZdirops�fZ	splitpath�fullpathZ	component�dr�r�Zcomp_resultrrr�dir_copy�st�

�
��



���r)NNr)NNNNNNr�)Xr7r�rg�loggingr�r��	functoolsrr�Zsalt.utils.argsr'Zsalt.utils.filesZsalt.utils.jsonZsalt.utils.pathZsalt.utils.platformZsalt.utils.stringutilsZlxmlr�ImportErrorZxml.etree.ElementTreeZElementTreeZjnpr.junos.cfgZjnprZ
jnpr.junos.oprrLr�Zjnpr.junos.utilsrrr�Z
jnpr.junosrZjnpr.junos.exceptionrrrr	Zjnpr.junos.factory.cfgtabler
Z!jnpr.junos.factory.factory_loaderrZjnpr.junos.factory.optablerZjnpr.junos.utils.configr
Zjnpr.junos.utils.scprZjnpr.junos.utils.swrr�	getLoggerr4r.rZ__proxyenabled__rrrIrNrSrZrYror�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrrrr�<module>s���
=4
!u[
b
w
6@I
K
1
0
#
 
�
4#
;
2/
.