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_show.pyo

�
�Udac@s�dZidd6dgd6dd6ZdZdZd	Zd
dlZd
dlmZd
�Zd�Z	d�Z
edkr�e
�ndS(s PN CLI show commands s1.1tmetadata_versiont
deprecatedtstatust	communitytsupported_bys:
---
module: pn_show
author: "Pluribus Networks (@amitsi)"
version_added: "2.2"
short_description: Run show commands on nvOS device.
deprecated:
  removed_in: '2.12'
  why: Doesn't support latest Pluribus Networks netvisor
  alternative: Latest modules will be pushed in Ansible future versions.
description:
  - Execute show command in the nodes and returns the results
    read from the device.
options:
  pn_cliusername:
    description:
      - Provide login username if user is not root.
    required: False
  pn_clipassword:
    description:
      - Provide login password if user is not root.
    required: False
  pn_cliswitch:
    description:
      - Target switch(es) to run the cli on.
    required: False
  pn_command:
    description:
      - The C(pn_command) takes a CLI show command as value.
    required: true
  pn_parameters:
    description:
      - Display output using a specific parameter. Use 'all' to display
        possible output. List of comma separated parameters.
    default: 'all'
  pn_options:
    description:
      - Specify formatting options.
st
- name: run the vlan-show command
  pn_show:
    pn_command: 'vlan-show'
    pn_parameters: id,scope,ports
    pn_options: 'layout vertical'

- name: run the vlag-show command
  pn_show:
    pn_command: 'vlag-show'
    pn_parameters: 'id,name,cluster,mode'
    pn_options: 'no-show-headers'

- name: run the cluster-show command
  pn_show:
    pn_command: 'cluster-show'
s�
command:
  description: The CLI command run on the target node(s).
  returned: always
  type: str
stdout:
  description: The set of responses from the show command.
  returned: always
  type: list
stderr:
  description: The set of error responses from the show command.
  returned: on error
  type: list
changed:
  description: Indicates whether the CLI caused any change on the target.
  returned: always(False)
  type: bool
i����N(t
AnsibleModulecCs�|jd}|jd}|jd}|rF|rFd||f}nd}|r||dkrk|d7}q||d|7}n|S(	s
    This method is to generate the cli portion to launch the Netvisor cli.
    It parses the username, password, switch parameters from module.
    :param module: The Ansible module to fetch username, password and switch
    :return: returns the cli string for further processing
    tpn_cliusernametpn_clipasswordtpn_cliswitchs"/usr/bin/cli --quiet --user %s:%s s/usr/bin/cli --quiet tlocals switch-local s switch (tparams(tmoduletusernametpasswordt	cliswitchtcli((sM/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/_pn_show.pytpn_clims



c		Cs�|jd}|jd}tj|�}|j|�\}}}|j|�d}|dkr�|jd|dd|d|j�d	t�n|r�|jd|dd|d
|j�d	t�n |jd|dd|d	t�dS(
s
    This method executes the cli command on the target node(s) and returns the
    output. The module then exits based on the output.
    :param cli: the complete cli string to be executed on the target node(s).
    :param module: The Ansible module to fetch command
    Rt
pn_commandiitcommandtmsgs%s: tstderrtchangedtstdouts%s: Nothing to display!!!N(R
tshlextsplittrun_commandt	exit_jsontstriptFalse(	RRRRtcmdtresulttoutterrt	print_cli((sM/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/_pn_show.pytrun_cli�s*

	

	

	
cCs�tdtdtdtdd�dtdtdddt�dtdtdd�d	tdtdd�d
tdddd�d
tdd���}|jd	}|jd
}|jd
}t|�}|d||f7}|r�||7}nt||�dS(s' This section is for arguments parsing t
argument_specRtrequiredttypetstrRtno_logRRt
pn_parameterstdefaulttallt
pn_optionss %s format %s N(RtdicttTrueRR
RR"(RRt
parameterstoptionsR((sM/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/_pn_show.pytmain�s 



t__main__(t__doc__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRtansible.module_utils.basicRRR"R0t__name__(((sM/usr/lib/python2.7/site-packages/ansible/modules/network/netvisor/_pn_show.pyt<module>s


)		*	

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