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/sros.pyo

�
�Udac@`s�ddlmZmZmZeZdZddlZddlZddl	m
Z
mZddlm
Z
ddlmZddlmZy:ddlmZdd	lmZdd
lmZeZWneefk
r�eZnXdefd��YZdS(
i(tabsolute_importtdivisiontprint_functions�
---
netconf: sros
short_description: Use Nokia SROS netconf plugin to run netconf commands on Nokia SROS platform
deprecated:
    why: This plugin moved in 'nokia.sros' collection
    removed_in: '2.13'
    alternative: "Use the netconf plugin in 'nokia.sros' collection within Ansible galaxy"
description:
  - This sros plugin provides low level abstraction apis for
    sending and receiving netconf commands from Nokia sros network devices.
version_added: "2.9"
options:
  ncclient_device_handler:
    type: str
    default: default
    description:
      - Specifies the ncclient device handler name for Nokia sros network os. To
        identify the ncclient device handler name refer ncclient library documentation.
N(tto_textt	to_native(tAnsibleConnectionFailure(tNetconfBase(tensure_ncclient(tmanager(tSSHUnknownHostError(tto_eletNetconfcB`s>eZd�Zed��Zd�Zeed���ZRS(cC`s>y&t|j|�jdd�j�SWntk
r9nXdS(Nterrorstsurrogate_then_replace(RtfindttexttstriptAttributeError(tselftelettag((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pytget_text=s&
cC`s�t�}d|d<d}d|}t|jjdd|f�j�}|jd|�|d<|jd	|�|d
<|jd|�|d<d
|d<|S(Ntsrost
network_oss#urn:nokia.com:sros:ns:yang:sr:statesP<state xmlns="%s"><system><platform/><bootup/><version/><lldp/></system></state>tfiltertsubtrees-.//{%s}state/{*}system/{*}lldp/{*}system-nametnetwork_os_hostnames3.//{%s}state/{*}system/{*}version/{*}version-numbertnetwork_os_versions".//{%s}state/{*}system/{*}platformtnetwork_os_models
Nokia 7x50tnetwork_os_platform(tdictR
tmtgettdata_xmltfindtext(Rtdevice_infotxmlnstftreply((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pytget_device_infoCs	

$
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_apiR#tserver_capabilitiestclient_capabilitiest
session_idtdevice_operations(
Rtget_base_rpcR'RR+R,R-tget_device_operationstjsontdumps(Rtresulttc((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pytget_capabilitiesRs	
##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}q�q�W|j�|S(Nthosttporti>tusernametpasswordtkey_filenamethostkey_verifythost_key_checkingt
look_for_keystallow_agentttimeouttpersistent_connect_timeoutt
ssh_configsurn:nokia.com:sros:ns:yang:srR(Rtconnectt
_play_contexttremote_addrR7tremote_userR9R:t
get_optionR>t_ssh_configR	RRtNoneR+tretsearcht
close_session(tobjRtexct
guessed_osR4((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pytguess_network_os]s(		

(t__name__t
__module__RRR'R5tstaticmethodRO(((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pyR<s
		(t
__future__RRRttypet
__metaclass__t
DOCUMENTATIONR1RItansible.module_utils._textRRtansible.errorsRtansible.plugins.netconfRRtncclientRtncclient.transport.errorsR	t
ncclient.xml_R
tTruetHAS_NCCLIENTtImportErrorRtFalseR(((s@/usr/lib/python2.7/site-packages/ansible/plugins/netconf/sros.pyt<module>s 



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