Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/storage/netapp/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddljjZddlmZej�Zdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiontpreviewtstatust	certifiedtsupported_byst
module: na_ontap_fcp
short_description: NetApp ONTAP Start, Stop and Enable FCP services.
extends_documentation_fragment:
    - netapp.na_ontap
version_added: '2.7'
author: NetApp Ansible Team (@carchi8py) <[email protected]>
description:
- Start, Stop and Enable FCP services.
options:
  state:
    description:
    - Whether the FCP should be enabled or not.
    choices: ['present', 'absent']
    default: present

  status:
    description:
    - Whether the FCP should be up or down
    choices: ['up', 'down']
    default: up

  vserver:
    description:
    - The name of the vserver to use.
    required: true

s�
    - name: create FCP
      na_ontap_fcp:
        state: present
        status: down
        hostname: "{{hostname}}"
        username: "{{username}}"
        password: "{{password}}"
        vserver:  "{{vservername}}"
s

N(t
AnsibleModule(t	to_native(tNetAppModuletNetAppOntapFCPcB`sVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s 
    Enable and Disable FCP
    cC`stj�|_|jjtdtdtdddgdd�dtdtdd	�d
tdtdddgdd���td
|jdt�|_t	�|_
|j
j|jj�|_
ttkr�|jjdd�n%tjd|jd|j
d�|_dS(NtstatetrequiredtchoicestpresenttabsenttdefaulttvserverttypetstrRtuptdownt
argument_spectsupports_check_modetmsgs(the python NetApp-Lib module is requiredtmodule(tnetapp_utilstna_ontap_host_argument_specRtupdatetdicttFalsetTrueRRR
t	na_helpertset_parameterstparamst
parameterstHAS_NETAPP_LIBt	fail_jsontsetup_na_ontap_zapitserver(tself((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyt__init__Hs!%	%cC`sly#|jjtjjd�t�WnBtjjk
rg}|jjddt	|�dt
j��nXdS(sB
        Create's and Starts an FCP
        :return: none
        sfcp-service-createRsError creating FCP: %st	exceptionN(R(tinvoke_successfullyRtzapit	NaElementR t
NaApiErrorRR&R	t	tracebackt
format_exc(R)terror((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyt
create_fcp^s#
cC`s�y#|jjtjjd�t�Wn[tjjk
r�}t|j�dkrTdS|j
jddt|�dtj
��nXdS(s>
        Starts an existing FCP
        :return: none
        sfcp-service-startt13013RsError starting FCP %sR+N(R(R,RR-R.R R/R	tcodetNoneRR&R0R1(R)R2((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyt	start_fcpjs#cC`sly#|jjtjjd�t�WnBtjjk
rg}|jjddt	|�dt
j��nXdS(s=
        Steps an Existing FCP
        :return: none
        sfcp-service-stopRsError Stopping FCP %sR+N(R(R,RR-R.R R/RR&R	R0R1(R)R2((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytstop_fcpys#
cC`sly#|jjtjjd�t�WnBtjjk
rg}|jjddt	|�dt
j��nXdS(sB
        Destroys an already stopped FCP
        :return:
        sfcp-service-destroyRsError destroying FCP %sR+N(R(R,RR-R.R R/RR&R	R0R1(R)R2((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytdestroy_fcp�s#
cC`s�tjjd�}tjjd�}|jd|jd�tjjd�}|j|�|j|�|jj|t�}|j	d�r�t
|jd��dkr�tStSdS(Nsfcp-service-get-itersfcp-service-infoRtquerysnum-recordsi(
RR-R.t
add_new_childR$tadd_child_elemR(R,R tget_child_by_nametinttget_child_contentR(R)tfcp_objtfcp_infoR:tresult((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytget_fcp�s

cC`s�y8|jjtjjd�t�}|jd�dkSWnBtjjk
r|}|jj	ddt
|�dtj��nXdS(Nsfcp-service-statussis-availablettrueRsError destroying FCP: %sR+(
R(R,RR-R.R R?R/RR&R	R0R1(R)RR2((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytcurrent_status�s!
cC`s[tj|j�}tjd|jd|�}tjd|�|j�}t}|jddkr|r�|jddkr�|j	�s�|j
�t}q�q|j	�r|j�t}qqD|j
�|jddkr�|j
�n |jddkr	|j�nt}n2|rD|j	�r1|j�n|j�t}n|jjd	|�dS(
NRRtna_ontap_fcpRRRRRtchanged(Rtget_cserverR(R'Rt
ems_log_eventRCRR$RER7R R8R3R9t	exit_json(R)tresultstcservertexistsRG((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytapply�s4




	

	(t__name__t
__module__t__doc__R*R3R7R8R9RCRERN(((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyRCs								cC`st�}|j�dS(s.
    Start, Stop and Enable FCP services.
    N(RRN(tobj((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pytmain�s	t__main__(t
__future__RRRRt
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR0tansible.module_utils.basicRtansible.module_utils._textR	tansible.module_utils.netapptmodule_utilstnetappRt"ansible.module_utils.netapp_moduleR
thas_netapp_libR%tobjectRRSRO(((sO/usr/lib/python2.7/site-packages/ansible/modules/storage/netapp/na_ontap_fcp.pyt<module>s"


�	

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