Anons79 Mini Shell

Directory : /proc/self/root/lib/python2.7/site-packages/ansible/plugins/netconf/
Upload File :
Current File : //proc/self/root/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyo

�
�Udac@`s2ddlmZmZmZeZdZddlZddlZddl	Z	ddl
mZmZddl
mZddlmZmZddlmZddlmZmZyJdd	lmZdd
lmZddlmZddlmZeZ Wne!e"fk
re#Z nXd
efd��YZ$dS(i(tabsolute_importtdivisiontprint_functions=
---
author: Ansible Networking Team
netconf: iosxr
short_description: Use iosxr netconf plugin to run netconf commands on Cisco IOSXR platform
description:
  - This iosxr plugin provides low level abstraction apis for
    sending and receiving netconf commands from Cisco iosxr network devices.
version_added: "2.9"
options:
  ncclient_device_handler:
    type: str
    default: iosxr
    description:
      - Specifies the ncclient device handler name for Cisco iosxr network os. To
        identify the ncclient device handler name refer ncclient library documentation.
N(t	to_nativetto_text(tremove_namespaces(t	build_xmlt
etree_find(tAnsibleConnectionFailure(tNetconfBasetensure_ncclient(tmanager(tRPCError(tSSHUnknownHostError(tto_xmltNetconfcB`s�eZd�Zd�Zeed���Zded�Z	dded�Z
dddddded�Zedded�Zded	�Z
ed
�ZRS(c
C`s!i}d|d<tj�}|jdidd6td6fdidd6td6td	6fd
idd6td6fdid
d6td6fdidd6td6fdidd6dd6fg�td|dd�}y!|j|�}ttjdd|��}t	|d�}|dk	r7tjd|j�d|d<nt	|d�}|dk	r|j|d<tjd|j�d |d!<ntd"dd�}|j|�}ttjdd|��}t	|j
�d#�}	|	dk	r�|	jnd|d$<Wn*tk
r}
|jjd%d&|
�nX|S('Ntiosxrt
network_ossboot-variablessinstall/boot-variablestxpathttags
boot-variables$install/boot-variables/boot-variabletleadtsoftwaresinstall/softwares
alias-devicessinstall/software/alias-devicessalias-devices+install/software/alias-devices/alias-devices
m:device-names7install/software/alias-devices/alias-device/device-namesdisk0:tvaluetinstalltopcodetfilters(<\?xml version="1.0" encoding="UTF-8"\?>tsboot-variable/boot-variables[:|,]itnetwork_os_imagespackage-nametnetwork_os_packaget-i����tnetwork_os_versions
host-namess	host-nametnetwork_os_hostnametvvvvsFail to retrieve device info %s(tcollectionstOrderedDicttupdatetTrueRtgetRtretsubRtNonetsplitttexttstript	Exceptiont_connectiont
queue_message(tselftdevice_infotinstall_metatinstall_filtertreplytresptele_boot_variabletele_package_namethostname_filterthostname_eletexc((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pytget_device_info>s:
 
 #cC`s�t�}|j�|d<d|d<|j�|d<g|jjD]}|^q@|d<g|jjD]}|^qc|d<|jj|d<|j|d�|d<tj	|�S(	Ntrpctnetconftnetwork_apiR0tserver_capabilitiestclient_capabilitiest
session_idtdevice_operations(
tdicttget_base_rpcR:tmR>R?R@tget_device_operationstjsontdumps(R/tresulttc((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pytget_capabilities`s	
##cC`s�y�tjd|jjd|jjp'dd|jjd|jjd|jd|jd�d	|jd	�d
|jj	d|jd�d
|j
�
}Wn%tk
r�}tt
|���nXd}x-|jD]"}tjd|�r�d}Pq�q�W|j�|S(s�
        Guess the remote network os name
        :param obj: Netconf connection class object
        :return: Network OS name
        thosttporti>tusernametpasswordtkey_filenamethostkey_verifythost_key_checkingt
look_for_keystallow_agentttimeouttpersistent_connect_timeoutt
ssh_configsIOS-XRRN(Rtconnectt
_play_contexttremote_addrRLtremote_userRNROt
get_optionRSt_ssh_configR
RRR(R>R&tsearcht
close_session(tobjRDR9t
guessed_osRI((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pytguess_network_osks*		
cC`s�t|t�rt|�}nyS|jjd|�}|rKt|�}n!t|d�rc|jn|j}|SWn(t	k
r�}t
t|j���nXdS(NRtdata_xml(t
isinstancetlistttupleRDR%RthasattrRbtxmlRR,R(R/Rt	remove_nsR4tresponseR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyR%�s!cC`s�t|t�rt|�}nyY|jjd|d|�}|rQt|�}n!t|d�ri|jn|j}|SWn(t	k
r�}t
t|j���nXdS(NtsourceRRb(RcRdReRDt
get_configRRfRbRgRR,R(R/RjRRhR4RiR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyRk�s!Rgt	candidatecC`s�|dkrtd��nyn|jj|d|d|d|d|d|�}|rct|�}	n!t|d�r{|jn|j}	|	SWn(tk
r�}
t	t
|
j���nXdS(Nsconfig value must be providedtformatttargettdefault_operationttest_optionterror_optionRb(R(t
ValueErrorRDtedit_configRRfRbRgRR,R(R/tconfigRmRnRoRpRqRhR4RiR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyRs�s'	!cC`s�t|dd�}y_|jjd|d|d|�}|rKt|�}n!t|d�rc|jn|j}|SWn(tk
r�}tt	|j���nXdS(Nterrorstsurrogate_or_strictt	confirmedRTtpersistRb(
RRDtcommitRRfRbRgRR,R(R/RwRTRxRhR4RiR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyRy�s!!cC`s�yS|jjd|�}|r-t|�}n!t|d�rE|jn|j}|SWn(tk
r}}tt|j���nXdS(NRjRb(	RDtvalidateRRfRbRgRR,R(R/RjRhR4RiR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyRz�s!cC`s|yM|jj�}|r't|�}n!t|d�r?|jn|j}|SWn(tk
rw}tt|j���nXdS(NRb(	RDtdiscard_changesRRfRbRgRR,R(R/RhR4RiR9((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyR{�s!N(t__name__t
__module__R:RJtstaticmethodR
RaR(tFalseR%RkRsRyRzR{(((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyR=s	"	#


(%t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONRFR&R!tansible.module_utils._textRRt+ansible.module_utils.network.common.netconfRt(ansible.module_utils.network.iosxr.iosxrRRtansible.errorsRtansible.plugins.netconfR	R
tncclientRtncclient.operationsRtncclient.transport.errorsR
t
ncclient.xml_RR$tHAS_NCCLIENTtImportErrortAttributeErrorRR(((sA/usr/lib/python2.7/site-packages/ansible/plugins/netconf/iosxr.pyt<module>s&



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