Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/onyx/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
dd
lmZddlmZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys$
---
module: onyx_protocol
version_added: "2.5"
author: "Samer Deeb (@samerd)"
short_description: Enables/Disables protocols on Mellanox ONYX network devices
description:
  - This module provides a mechanism for enabling and disabling protocols
    Mellanox on ONYX network devices.
notes:
  - Tested on ONYX 3.6.4000
options:
  mlag:
    description: MLAG protocol
    choices: ['enabled', 'disabled']
  magp:
    description: MAGP protocol
    choices: ['enabled', 'disabled']
  spanning_tree:
    description: Spanning Tree support
    choices: ['enabled', 'disabled']
  dcb_pfc:
    description: DCB priority flow control
    choices: ['enabled', 'disabled']
  igmp_snooping:
    description: IP IGMP snooping
    choices: ['enabled', 'disabled']
  lacp:
    description: LACP protocol
    choices: ['enabled', 'disabled']
  ip_l3:
    description: IP L3 support
    choices: ['enabled', 'disabled']
  ip_routing:
    description: IP routing support
    choices: ['enabled', 'disabled']
  lldp:
    description: LLDP protocol
    choices: ['enabled', 'disabled']
  bgp:
    description: BGP protocol
    choices: ['enabled', 'disabled']
  ospf:
    description: OSPF protocol
    choices: ['enabled', 'disabled']
  nve:
    description: nve protocol
    choices: ['enabled', 'disabled']
    version_added: "2.9"
s�
- name: enable protocols for MLAG
  onyx_protocol:
    lacp: enabled
    spanning_tree: disabled
    ip_routing: enabled
    mlag: enabled
    dcb_pfc: enabled
s�
commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  type: list
  sample:
    - no spanning-tree
    - protocol mlag
(t
AnsibleModule(t	iteritems(tBaseOnyxModule(tshow_cmdtOnyxProtocolModulecB`s�eZededddddd�dedddddd�d	edd
dd
dd�dedd
dddd�dedddddd�dedddddd�dedddddd�dedddddd�dedddddd�d edd dd!dd"�d#edd#dd$dd%�d&edd&dd'dd(��Zed)��Zd*�Zd+�Zd,�Zd-�Z	d.�Z
d/�ZRS(0tmlagtnametenables
protocol mlagtdisablesno protocol mlagtmagps
protocol magpsno protocol magpt
spanning_trees
spanning-treesno spanning-treetdcb_pfcspriority-flow-controls&dcb priority-flow-control enable forces)no dcb priority-flow-control enable forcet
igmp_snoopings
igmp-snoopingsip igmp snoopingsno ip igmp snoopingtlacpsno lacptip_l3sIP L3sip l3sno ip l3t
ip_routings
IP routings
ip routings
no ip routingtlldpsno lldptbgpsprotocol bgpsno protocol bgptospfs
protocol ospfsno protocol ospftnvesprotocol nvesno protocol nvecC`s:t�}x*|jD]}tdddg�||<qW|S(Ntchoicestenabledtdisabled(tdicttPROTOCOL_MAPPING(tclstelement_spectprotocol((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyt_get_element_specvs	cC`s>|j�}t�}|j|�td|dt�|_dS(s' Ansible module initialization
        t
argument_spectsupports_check_modeN(R$RtupdateRtTruet_module(tselfR"R%((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pytinit_module}s	
cC`sdt�|_|jj}xEt|�D]7\}}||jkr%|dk	r%||j|<q%q%WdS(N(Rt_required_configR)tparamsR	R tNone(R*t
module_paramstkeytval((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pytget_required_config�s
cC`st|jd�S(Nsshow protocols(RR)(R*((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyt_get_protocols�scC`st|jddt�S(Ns&show ip routing | include "IP routing"tjson_fmt(RR)tFalse(R*((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyt_get_ip_routing�scC`st�|_|j�}|s*t�}n|j�}|r�|jd�}xk|D]`}|j�}|jd�}t|�dkrR|dj�}|dj�}|||<qRqRWnx[t|j�D]J\}}	|	d}
|j	|
d�}|d	krd}n||j|<q�WdS(
Ns
t:iiiRRR(senabledsdisabled(
Rt_current_configR3R6tsplittstriptlenR	R tget(R*tprotocols_configt	ip_configtlinestlinet	line_attrtattrR1R#tprotocol_metadatatprotocol_json_attr((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pytload_current_config�s(

	cC`s�x�t|j�D]p\}}|j|}|jj|d�}||kr|dkrc|d}n
|d}|jj|�qqWdS(NRRR(R	R,R R8R<t	_commandstappend(R*R#treq_valRCtcurr_valtcommand((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pytgenerate_commands�s


(t__name__t
__module__RR tclassmethodR$R+R2R3R6RERK(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyR[s<													cC`stj�dS(s+ main entry point for module execution
    N(Rtmain(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyRO�st__main__N(t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRtansible.module_utils.sixR	t&ansible.module_utils.network.onyx.onyxR
RRRORL(((sN/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_protocol.pyt<module>s


3

]	

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