
    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: aireos
short_description: Use aireos cliconf to run command on Cisco WLC platform
description:
  - This aireos plugin provides low level abstraction apis for
    sending and receiving CLI commands from Cisco WLC 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|      }|r|j                  d      |d<   t        j                  d	|t        j                        }|r|j                  d      |d
<   | j                  d      }t        |d      j                         }t        j                  d|t        j                        }|r|j                  d      |d<   |S )Naireos
network_oszshow sysinfosurrogate_or_strict)errorszProduct Version\.* (.*)   network_os_versionzSystem Name\.* (.*)network_os_hostnamezshow inventoryzDESCR: \"(.*)\"network_os_model)getr   stripresearchgroupM)selfdevice_inforeplydatamatchs        l/home/dcms/DCMS/lib/python3.12/site-packages/ansible_collections/community/network/plugins/cliconf/aireos.pyget_device_infozCliconf.get_device_info1   s    $,L!(u%:;AAC		4d;05AK,-		0$=16QK-.)*u%:;AAC		,dBDD9.3kk!nK*+    c                 h    |dvr| j                  d|z        S |dk(  rd}nd}| j                  |      S )N)runningstartupz/fetching configuration from %s is not supportedr&   zshow run-config commandsz show run-config startup-commands)invalid_paramssend_command)r   sourceflagsformatcmds        r"   
get_configzCliconf.get_configH   sF    //&&'X[a'abbY,C4C  %%r$   c                 `    t        dgt        |      dg      D ]  }| j                  |        y )Nconfigend)r   r	   r)   )r   commandr-   s      r"   edit_configzCliconf.edit_configR   s1    (WW%5w? 	#Cc"	#r$   c                 0    | j                  ||||||      S )N)r2   promptanswersendonlynewline	check_all)r)   )r   r2   r5   r6   r7   r8   r9   s          r"   r   zCliconf.getW   s-      Yakr  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_capabilitiesZ   s!    w68zz&!!r$   c                 V    | j                   j                  r| j                  d       yy)zT
        Make sure we are in the operational cli mode
        :return: None
        z)#)config_contextN)_connection	connected_update_cli_prompt_context)r   s    r"   set_cli_prompt_contextzCliconf.set_cli_prompt_context^   s)    
 %%++4+@ &r$   )r&   Ntext)NNFTF)__name__
__module____qualname__r#   r   r.   r3   r   r<   rF   __classcell__)r@   s   @r"   r   r   /   sA    . & & # #I"Ar$   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>rV      s?   & C B 
   3 . c <5Ak 5Ar$   