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_log_audit_exception.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_log_audit_exception
author: "Pluribus Networks (@rajaspachipulusu17)"
version_added: "2.9"
short_description: CLI command to create/delete an audit exception
description:
  - This module can be used to create an audit exception and delete an audit exception.
options:
  pn_cliswitch:
    description:
      - Target switch to run the CLI on.
    required: false
    type: str
  pn_audit_type:
    description:
      - Specify the type of audit exception.
    required: false
    type: str
    choices: ['cli', 'shell', 'vtysh']
  state:
    description:
      - State the action to perform. Use 'present' to create audit-exception and
        'absent' to delete audit-exception.
    required: false
    type: str
    choices: ['present', 'absent']
    default: 'present'
  pn_pattern:
    description:
      - Specify a regular expression to match exceptions.
    required: false
    type: str
  pn_scope:
    description:
      - scope - local or fabric.
    required: false
    type: str
    choices: ['local', 'fabric']
  pn_access:
    description:
      - Specify the access type to match exceptions.
    required: true
    type: str
    choices: ['any', 'read-only', 'read-write']
sK
- name: create a log-audit-exception
  pn_log_audit_exception:
    pn_audit_type: "cli"
    pn_pattern: "test"
    state: "present"
    pn_access: "any"
    pn_scope: "local"

- name: delete a log-audit-exception
  pn_log_audit_exception:
    pn_audit_type: "shell"
    pn_pattern: "test"
    state: "absent"
    pn_access: "any"
s�
command:
  description: the CLI command run on the target node.
  returned: always
  type: str
stdout:
  description: set of responses from the pn_log_audit_exceptions command.
  returned: always
  type: list
stderr:
  description: set of error responses from the log_audit_exceptions 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_commandscC`sr|jd}|jd}|jd}|jd}|jd}|d7}|d7}|d7}t||�d	}|rn|j�jd
�}x�|D]�}	|	jd�}
d}|
d|kr�|d	7}n|
d	|kr�|d	7}n|
d
|kr|d	7}n|dkr/|
d|kr/|d	7}n|dkrK|dkrKtS|dkr�|dkr�tSq�WntS(s
    This method checks for idempotency using the log-audit-exception command.
    If a list with given name exists, return exists as True else False.
    :param module: The Ansible module to fetch input parameters.
    :return Booleans: True or False.
    tstatet
pn_audit_typet
pn_patternt	pn_accesstpn_scopes log-audit-exception-shows no-show-headers format s/ type,pattern,access,scope parsable-delim DELIMis
tDELIMiitpresentitabsenti(tparamsRtstriptsplittTruetFalse(tmoduletcliRt
audit_typetpatterntaccesstscopetstdouttlinelisttlinetwordlisttcount((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_log_audit_exception.pyt	check_clifs6












cC`s&tdddd�}tdtdtdd�d	tdtdd�d
tdtddd|j�dd�d
tdtddddddg�dtdtddddddg�dtdtdddddg��}td|dd
ddggf�}|jd}|jd
}|jd
}|jd}|jd	}|jd}||}	t||�}
t||
�}|
d|	|||f7}
|dkr�|tkr�|jdtdd�nt	||
|�nR|dkr"|tkr|jdtdd�n|
d|7}
t	||
|�nd S(!s' This section is for arguments parsing Rslog-audit-exception-createRslog-audit-exception-deletetpn_cliswitchtrequiredttypetstrRRtchoicestdefaultRtanys	read-onlys
read-writeR
RtshelltvtyshRtlocaltfabrict
argument_spectrequired_ifs %s %s pattern %s %stskippedtmsgs-This audit log exception entry does not exists-This audit log exception entry already existss
 scope %s N(
tdictRRtkeysRRR	R$t	exit_jsonR
(t	state_mapR0Rt	cliswitchRRRRRtcommandRtaudit_log_exists((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_log_audit_exception.pytmain�sJ	$$$






	
	
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.netvisorRR$R;t__name__(((s[/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/pn_log_audit_exception.pyt<module>s


0	(	=

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