�
�Udac @` s� d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d
Z d d l
m Z d d l m
Z
m Z d d
l m Z d � Z d � Z e d k r� e � n d S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont previewt statust communityt supported_bys�
---
module: pn_vrouter_pim_config
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to modify vrouter-pim-config
description:
- This module can be used to modify pim parameters.
options:
pn_cliswitch:
description:
- Target switch to run the CLI on.
required: false
type: str
state:
description:
- State the action to perform. Use C(update) to modify the vrouter-pim-config.
required: true
type: str
choices: ['update']
pn_query_interval:
description:
- igmp query interval in seconds.
required: false
type: str
pn_querier_timeout:
description:
- igmp querier timeout in seconds.
required: false
type: str
pn_hello_interval:
description:
- hello interval in seconds.
required: false
type: str
pn_vrouter_name:
description:
- name of service config.
required: false
type: str
s�
- name: pim config modify
pn_vrouter_pim_config:
pn_cliswitch: '192.168.1.1'
pn_query_interval: '10'
pn_querier_timeout: '30'
state: 'update'
pn_vrouter_name: 'ansible-spine1-vrouter'
s�
command:
description: the CLI command run on the target node.
returned: always
type: str
stdout:
description: set of responses from the vrouter-pim-config command.
returned: always
type: list
stderr:
description: set of error responses from the vrouter-pim-config command.
returned: on error
type: list
changed:
description: indicates whether the CLI caused changes on the target.
returned: always
type: bool
( t
AnsibleModule( t pn_clit run_cli( t run_commandsc C` s� | j d } | } | d 7} t | | � d } | rE | j � } n | | k rT n t S| } | d | 7} t | | � d } | r� | j � } n d | k r� t St S( s�
This method checks for pim ssm config using the vrouter-show command.
If a user already exists on the given switch, return True else False.
:param module: The Ansible module to fetch input parameters
:param cli: The CLI string
t pn_vrouter_names* vrouter-show format name no-show-headers i s8 vrouter-show name %s format proto-multi no-show-headerst none( t paramsR t splitt Falset True( t modulet clit namet showt out( ( sZ /usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_vrouter_pim_config.pyt check_cliZ s
c C` s� t d d � } t d t d t d t d d � d t d t d d d | j � � d
t d t d d � d t d t d d � d t d t d d � d
t d t d d � � d d d d
g g f d d
d d g g � } | j d } | j d } | j d
} | j d } | j d } | j d
} | | } t | | � } | d k r�t | | � }
|
t k ry| j d t d d � n | d | | f 7} | r�| d | 7} n | r�| d | 7} n | r�| d | 7} q�n t | | | � d S( s'