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_igmp_interface.pyc

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddl
mZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys
---
module: onyx_igmp_interface
version_added: "2.8"
author: "Anas Badaha (@anasb)"
short_description: Configures IGMP interface parameters
description:
  - This module provides declarative management of IGMP interface configuration
    on Mellanox ONYX network devices.
notes:
  - Tested on ONYX 3.6.8130
options:
  name:
    description:
    - interface name that we want to configure IGMP on it
    required: true
  state:
    description:
      - IGMP Interface state.
    choices: ['enabled', 'disabled']
    default: enabled
s]
- name: configure igmp interface
  onyx_igmp_interface:
    state: enabled
    name: Eth1/1
s�
commands:
  description: The list of configuration mode commands to send to the device.
  returned: always
  type: list
  sample:
    - interface ethernet 1/1 ip igmp snooping fast-leave
N(t
AnsibleModule(tshow_cmd(tBaseOnyxModuletOnyxIgmpInterfaceModulecB`s_eZejd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd�ZRS(	s^(Eth\d+\/\d+|Eth\d+\/\d+\d+)$cC`setdtdddgdd�dtdt��}t�}|j|�td|d	t�|_d
S(s initialize module
        tstatetchoicestenabledtdisabledtdefaulttnametrequiredt
argument_spectsupports_check_modeN(tdicttTruetupdateRt_module(tselftelement_specR((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pytinit_module>s	
cC`s]|jj}t|�|_|jj|jd�}|sItd��n|j|j�dS(NRs"Please Insert Valid Interface Name(RtparamsRt_required_configt
IF_NAME_REGEXtmatchtAttributeErrortvalidate_param_values(Rt
module_paramsR((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pytget_required_configKscC`s`|s
dS|jjd�}||djd�}|dkrOd|jd<n
d|jd<dS(NRis
leave-modetFastRRR(Rtgett_current_config(Rtigmp_interfaces_configRtinterface_state((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyt_set_igmp_configTscC`s"d}t|j|dtdt�S(Ns show ip igmp snooping interfacestjson_fmtt
fail_on_error(R	RRtFalse(Rtcmd((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyt_show_igmp_interfaces^scC`s2t�|_|j�}|r.|j|�ndS(N(RR&R.R)(RR'((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pytload_current_configbscC`sU|jd}|jjd�jdd�|_|dkrG|j�n
|j�dS(NRRtEths	ethernet R(RR%treplacet_req_valt_generate_igmp_interface_cmdst_generate_no_igmp_cmds(Rt	req_state((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pytgenerate_commandshs

!
cC`sN|jjdd�}|dkr$n&|dkrJ|jjd|j�ndS(NRRRs(interface %s ip igmp snooping fast-leave(R&R%t	_commandstappendR2(Rt
curr_state((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyR3qs
cC`s?|jjdd�}|dkr;|jjd|j�ndS(NRRs+interface %s no ip igmp snooping fast-leave(R&R%R7R8R2(RR9((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyR4ys(
t__name__t
__module__tretcompileRRR#R)R.R/R6R3R4(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyR;s	
			
					cC`stj�dS(s+ main entry point for module execution
    N(Rtmain(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyR>�st__main__(t
__future__RRRttypet
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR<tansible.module_utils.basicRt&ansible.module_utils.network.onyx.onyxR	R
RR>R:(((sT/usr/lib/python2.7/site-packages/ansible/modules/network/onyx/onyx_igmp_interface.pyt<module>s


	F	

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