Anons79 Mini Shell

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

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
mZddlm
Z
mZdd
lmZd�Zd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	communitytsupported_bys�
---
module: pn_prefix_list_network
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.8"
short_description: CLI command to add/remove prefix-list-network
description:
  - This module is used to add network associated with prefix list
    and remove networks associated with prefix list.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: false
    type: str
  state:
    description:
      - State the action to perform. Use C(present) to create
        prefix-list-network and C(absent) to delete prefix-list-network.
    required: true
    type: str
    choices: ['present', 'absent']
  pn_netmask:
    description:
      - netmask of the network associated the prefix list.
    required: false
    type: str
  pn_name:
    description:
      - Prefix List Name.
    required: false
    type: str
  pn_network:
    description:
      - network associated with the prefix list.
    required: false
    type: str
s^
- name: prefix list network add
  pn_prefix_list_network:
    pn_cliswitch: "sw01"
    pn_name: "foo"
    pn_network: "172.16.3.1"
    pn_netmask: "24"
    state: "present"

- name: prefix list network remove
  pn_prefix_list_network:
    pn_cliswitch: "sw01"
    state: "absent"
    pn_name: "foo"
    pn_network: "172.16.3.1"
    pn_netmask: "24"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the prefix-list-network command.
  returned: always
  type: list
stderr:
  description: set of error responses from the prefix-list-network command.
  returned: on error
  type: list
changed:
  description: indicates whether the CLI caused changes on the target.
  returned: always
  type: bool
(t
AnsibleModule(tpn_clitrun_cli(trun_commandscC`s�|jd}|jd}|}|d7}t||�d}||j�dkrp|jdtdd|�n|}|d	|7}t||�\}}}|r�|j�d}||jd
�dkr�tStStS(s�
    This method checks for idempotency using prefix-list-network-show command.
    If network exists, return as True else False.
    :param module: The Ansible module to fetch input parameters
    :param cli: The CLI string
    tpn_namet
pn_networks- prefix-list-show format name no-show-headersii����tfailedtmsgs(Prefix list with name %s does not existss@ prefix-list-network-show name %s format network no-show-headerst/i(tparamsRtsplitt	fail_jsontTruetFalse(tmoduletclitnametnetworktshowtouttrcterr((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_prefix_list_network.pyt	check_cli^s 


	!c
C`stdddd�}tdtdtdtdd	�d
tdtdd	d|j��dtdtdd	�d
tdtdd	�dtdtdd	��dd
dd
ddggd
dd
ddggfdddgf�}|jd}|jd
}|jd}|jd
}|jd}||}t||�}t||�}	|d|7}|dkr�|	tkr�|jdtdd|�q�n|dkr�|	tkr�|jdtdd|�q�n|r�|d|7}n|r�|d|7}n|r|d|7}nt	|||�dS(s' This section is for arguments parsing tpresentsprefix-list-network-addtabsentsprefix-list-network-removet
argument_spectpn_cliswitchtrequiredttypetstrtstatetchoicest
pn_netmaskRR
trequired_iftrequired_togethers %s tskippedRs*Prefix list with network %s does not exists*Prefix list with network %s already existss name s	 network s	 netmask N(
tdictRRRtkeysRR	Rt	exit_jsonR
(
t	state_mapRt	cliswitchR&tnetmaskRRtcommandRtNETWORK_EXISTS((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_prefix_list_network.pytmain}sP	





		t__main__N(t
__future__RRRR$t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtansible.module_utils.basicRt-ansible.module_utils.network.netvisor.pn_nvosR	R
t.ansible.module_utils.network.netvisor.netvisorRRR4t__name__(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_prefix_list_network.pyt<module>s


(		A

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