Ë
    ÇVhî  ã                   ó†   — d dl mZmZmZ eZdZd dlZd dlZd dl	m
Z
 d dlmZ d dlmZ d dlmZ d dlmZmZ  G d	„ d
e«      Zy)é    )Úabsolute_importÚdivisionÚprint_functionaŽ  
---
deprecated:
  removed_in: 6.0.0
  why: This collection and all content in it is unmaintained and deprecated.
  alternative: Unknown.
author: Unknown (!UNKNOWN)
name: enos
short_description: Use enos cliconf to run command on Lenovo ENOS platform
description:
  - This enos plugin provides low level abstraction apis for
    sending and receiving CLI commands from Lenovo ENOS network devices.
N)Úchain)ÚAnsibleConnectionFailure)Úto_text)Úto_list)ÚCliconfBaseÚenable_modec                   óT   ‡ — e Zd Zd„ Zedd„«       Zed„ «       Zdd„Zˆ fd„Zd„ Z	ˆ xZ
S )	ÚCliconfc                 ó   — i }d|d<   | j                  d«      }t        |d¬«      j                  «       }t        j                  d|t        j
                  t        j                  z  «      }|r|j                  d«      |d<   t        j                  d	|t        j
                  t        j                  z  «      }|r|j                  d«      |d
<   t        j                  d|t        j
                  «      }|r|j                  d«      |d<   |S d|d<   |S )NÚenosÚ
network_oszshow versionÚsurrogate_or_strict©Úerrorsz^Software Version (.*?) é   Únetwork_os_versionz^Lenovo RackSwitch (\S+)Únetwork_os_modelz^(.+) uptimeÚnetwork_os_hostnameÚNA)Úgetr   ÚstripÚreÚsearchÚMÚIÚgroup)ÚselfÚdevice_infoÚreplyÚdataÚmatchs        új/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/network/plugins/cliconf/enos.pyÚget_device_infozCliconf.get_device_info.   sæ   € Øˆà$*ˆLÑ!Ø—‘˜Ó(ˆÜuÐ%:Ô;×AÑAÓCˆä—	‘	Ð5°t¼R¿T¹TÄBÇDÁD¹[ÓIˆÙØ05·±¸A³ˆKÐ,Ñ-ä—	‘	Ð5°t¼R¿T¹TÄBÇDÁD¹[ÓIˆÙØ.3¯k©k¸!«nˆKÐ*Ñ+ä—	‘	˜/¨4´·±Ó6ˆÙØ16·±¸Q³ˆKÐ-Ñ.ð Ðð 26ˆKÐ-Ñ.àÐó    c                 ól   — |dvrd}| j                  ||z  «      S |dk(  rd}nd}| j                  |«      S )N)ÚrunningÚstartupz/fetching configuration from %s is not supportedr)   zshow running-configzshow startup-config)Úinvalid_paramsÚsend_command)r    ÚsourceÚflagsÚformatÚmsgÚcmds         r%   Ú
get_configzCliconf.get_configE   sH   € àÐ/Ñ/ØCˆCØ×&Ñ& s¨V¡|Ó4Ð4ØYÒØ'‰Cà'ˆCØ× Ñ  Ó%Ð%r'   c                 ó`   — t        dgt        |«      dg«      D ]  }| j                  |«       Œ y )Nzconfigure terminalÚend)r   r	   r,   )r    Úcommandr1   s      r%   Úedit_configzCliconf.edit_configP   s3   € äÐ.Ð/´¸Ó1AÀEÀ7ÓKò 	#ˆCØ×Ñ˜cÕ"ñ	#r'   c                 ó0   — | j                  ||||||¬«      S )N)r5   ÚpromptÚanswerÚsendonlyÚnewlineÚ	check_all)r,   )r    r5   r8   r9   r:   r;   r<   s          r%   r   zCliconf.getU   s-   € Ø× Ñ ¨¸ÈÐYaÐkrð  HÐ ó  Ið  	Ir'   c                 óR   •— t         t        |   «       }t        j                  |«      S )N)Úsuperr   Úget_capabilitiesÚjsonÚdumps)r    ÚresultÚ	__class__s     €r%   r?   zCliconf.get_capabilitiesX   s!   ø€ Ü”w Ñ6Ó8ˆÜz‰z˜&Ó!Ð!r'   c                 óª  — | j                   j                  r½| j                   j                  «       }|€#t        d| j                   j                  z  ¬«      ‚t        |d¬«      j                  «       j                  d«      r8| j                   j                  dd«       | j                   j                  d	«       y| j                   j                  d
«       yy)zT
        Make sure we are in the operational cli mode
        :return: None
        NzGcli prompt is not identified from the last received response window: %s)ÚmessageÚsurrogate_then_replacer   z)#Úvvvvz&In Config mode, sending exit to deviceÚexitÚenable)
Ú_connectionÚ	connectedÚ
get_promptr   Ú_last_recv_windowr   r   ÚendswithÚqueue_messager,   )r    Úouts     r%   Úset_cli_prompt_contextzCliconf.set_cli_prompt_context\   s»   € ð
 ×Ñ×%Ò%Ø×"Ñ"×-Ñ-Ó/ˆCàˆ{Ü.ð 8OØQU×QaÑQa×QsÑQsñ8tô uð uô sÐ#;Ô<×BÑBÓD×MÑMÈdÔSØ× Ñ ×.Ñ.¨vÐ7_Ô`Ø× Ñ ×-Ñ-¨fÕ5à× Ñ ×-Ñ-¨hÕ7ð &r'   )r)   NÚtext)NNFTF)Ú__name__Ú
__module__Ú__qualname__r&   r   r2   r6   r   r?   rQ   Ú__classcell__)rC   s   @r%   r   r   ,   s@   ø„ òð. ò&ó ð&ð ñ#ó ð#óIô"ö8r'   r   )Ú
__future__r   r   r   ÚtypeÚ__metaclass__ÚDOCUMENTATIONr   r@   Ú	itertoolsr   Úansible.errorsr   Úansible.module_utils._textr   ÚOansible_collections.ansible.netcommon.plugins.module_utils.network.common.utilsr	   Úansible.plugins.cliconfr
   r   r   © r'   r%   ú<module>ra      s?   ð÷  CÑ BØ€ð€ó 
Û å å 3Ý .Ý cß <ô@8ˆkõ @8r'   