Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/network/nxos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pyc

�
�Udac@s�idd6dgd6dd6ZdZdZdZd	d
lZd	dlmZmZmZd	dlm	Z	m
Z
d	d
lmZidd6Z
d�Zd�Zd�Zd�Zd�Zd�Zedkr�e�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys
---
module: nxos_udld
extends_documentation_fragment: nxos
version_added: "2.2"
short_description: Manages UDLD global configuration params.
description:
    - Manages UDLD global configuration params.
author:
    - Jason Edelman (@jedelman8)
notes:
    - Tested against NXOSv 7.3.(0)D1(1) on VIRL
    - Module will fail if the udld feature has not been previously enabled.
options:
    aggressive:
        description:
            - Toggles aggressive mode.
        choices: ['enabled','disabled']
    msg_time:
        description:
            - Message time in seconds for UDLD packets or keyword 'default'.
    reset:
        description:
            - Ability to reset all ports shut down by UDLD. 'state' parameter
              cannot be 'absent' when this is present.
        type: bool
        default: 'no'
    state:
        description:
            - Manage the state of the resource. When set to 'absent',
              aggressive and msg_time are set to their default values.
        default: present
        choices: ['present','absent']

s�
# ensure udld aggressive mode is globally disabled and se global message interval is 20
- nxos_udld:
    aggressive: disabled
    msg_time: 20
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"

# Ensure agg mode is globally enabled and msg time is 15
- nxos_udld:
    aggressive: enabled
    msg_time: 15
    host: "{{ inventory_hostname }}"
    username: "{{ un }}"
    password: "{{ pwd }}"
s

proposed:
    description: k/v pairs of parameters passed into module
    returned: always
    type: dict
    sample: {"aggressive": "enabled", "msg_time": "40"}
existing:
    description:
        - k/v pairs of existing udld configuration
    returned: always
    type: dict
    sample: {"aggressive": "disabled", "msg_time": "15"}
end_state:
    description: k/v pairs of udld configuration after module execution
    returned: always
    type: dict
    sample: {"aggressive": "enabled", "msg_time": "40"}
updates:
    description: command sent to the device
    returned: always
    type: list
    sample: ["udld message-time 40", "udld aggressive"]
changed:
    description: check to see if a change was made on the device
    returned: always
    type: bool
    sample: true
i����N(t
get_configtload_configtrun_commands(tget_capabilitiestnxos_argument_spec(t
AnsibleModulet15tmsg_timecCsGg}x:|D]2}t|t�r2|j|�q
|j|�q
W|S(N(t
isinstancetlisttextendtappend(t
command_liststflat_command_listtcommand((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pytflatten_listvs
cCsqi}xd|j�D]V\}}|j|�}|r|j|�}|r\t|�||<qi|||<qqW|S(N(titemstgettstr(tkey_mapttabletnew_dicttkeytvaluetnew_key((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pyt
apply_key_map�scCs�g}x�|j�D]�\}}|dkrS|dkr=dnd}|j|�q|dkr|dkr�|jd�tjd�kr�|jd�q�q�|jd|�qqW|r�d	}|j|�n|S(
Nt
aggressivetenabledsudld aggressivesno udld aggressiveRtdefaultsno udld message-timesudld message-time s
udld reset(RRRtPARAM_TO_DEFAULT_KEYMAP(tdeltatresettexistingtcommandstparamRR((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pytget_commands_config_udld_global�scCsig}|jd�dkr1d}|j|�n|jd�tjd�kred}|j|�n|S(NRR sno udld aggressiveRsno udld message-time(RRR"(R%R&R((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pytget_commands_remove_udld_global�scCs�d}t||g�d}t|jdd��}|dkrId}nd}t|jdd��}td|d	|�}|S(
Nsshow udld global | jsonisudld-global-modesenabled-aggressiveR tdisabledsmessage-intervalRR(RRRtNonetdict(tmoduleRt
udld_tableRRtintervaltudld((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pytget_udld_global�s	c
Cs�tdtdtdddg�dtdtdd�d	tdtdd
�dtddd
gdd
��}|jt�td|dt�}t�}|jd}|jd}|jd	}|jd}|r�|dkr�|jdd�ntd|d|d	|�}td�|j	�D��}t
|�}	|	}
t|j	��j|	j	��}t}g}
|d
kr�|r�t
t|�||	�}|
j|�q�n1|dkr�t|	�}|r�|
j|�q�nt|
�}|rC|jr|jdtd|�qCt}t||�t
|�}
d|krC|jd�qCni}||d<|	|d<|
|d<||d<||d<||d<|j|�dS(NRtrequiredtchoicesR R*RttypeRR$tbooltstatetabsenttpresentR!t
argument_spectsupports_check_modetmsgs,state must be present when using reset flag.css-|]#\}}|dk	r||fVqdS(N(R+(t.0tktv((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pys	<genexpr>�stchangedR&t	configureitproposedR%t	end_statetupdatestwarnings(R,tFalsetupdateR	R
tTrueRtparamst	fail_jsonRR1tsett
differenceR(RR)Rt
check_modet	exit_jsonRtpop(R9R-RDRRR$R6targsRAR%RBR#R?R&Rtcmdstresults((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pytmain�s^
		



!	






t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNtret&ansible.module_utils.network.nxos.nxosRRRRR	tansible.module_utils.basicR
R"RRR(R)R1RRt__name__(((sJ/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_udld.pyt<module>s&


%
	
	
				A

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