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_rpm.pyc

�
�Udac@sidd6dgd6dd6ZdZdZdZd	d
lZd	dlmZd	dlmZm	Z	d	d
lm
Z
mZd	dlm
Z
d	dlmZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zedkre�nd
S(s1.1tmetadata_versiontpreviewtstatustnetworktsupported_bys`
---
module: nxos_rpm
extends_documentation_fragment: nxos
version_added: "2.7"
short_description: Install patch or feature rpms on Cisco NX-OS devices.
description:
    - Install software maintenance upgrade (smu) RPMS and
      3rd party RPMS on Cisco NX-OS devices.
author: Sai Chintalapudi (@saichint)
notes:
    - Tested against NXOSv 7.0(3)I2(5), 7.0(3)I4(6), 7.0(3)I5(3),
      7.0(3)I6(1), 7.0(3)I7(3)
    - For patches, the minimum platform version needed is 7.0(3)I2(5)
    - For feature rpms, the minimum platform version needed is 7.0(3)I6(1)
    - The module manages the entire RPM lifecycle (Add, activate, commit, deactivate, remove)
    - For reload patches, this module is NOT idempotent until the patch is
      committed.
options:
    pkg:
        description:
            - Name of the RPM package.
        required: true
    file_system:
        description:
            - The remote file system of the device. If omitted,
              devices that support a file_system parameter will use
              their default values.
        default: bootflash
    aggregate:
        description:
            - List of RPM/patch definitions.
    state:
        description:
            - If the state is present, the rpm will be installed,
              If the state is absent, it will be removed.
        default: present
        choices: ['present', 'absent']
sM
- nxos_rpm:
    pkg: "nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.3.lib32_n9000.rpm"
sg
commands:
    description: commands sent to the device
    returned: always
    type: list
    sample: ["install add bootflash:nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.3.lib32_n9000.rpm forced",
             "install activate nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.3.lib32_n9000 forced",
             "install commit nxos.sample-n9k_ALL-1.0.0-7.0.3.I7.3.lib32_n9000"]
i����N(tdeepcopy(tload_configtrun_commands(tnxos_argument_spect
check_args(t
AnsibleModule(tremove_default_speccCshd}i|d6dd6g}xD|dkrct||�d}|rI|Stjd�|d7}q WdS(Nitcommandttexttoutputi
ii(Rttimetsleep(Rtmodulet	iterationtcmdstbody((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytexecute_show_commandZs

cCs5dj||�}t||�}d|kr1tStS(Nsdir {0}:/{1}sNo such file(tformatRtFalsetTrue(Rtdsttfile_systemRR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytremote_file_existsjs
cCs�d}x||dkr�t||gt�}|r}d|dj�ks\d|dj�krvtjd�|d7}q�dSq	dSq	WdS(Nii
s(another install operation is in progresstfailedii(RRtlowerRR(RtcmdRtmsg((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytconfig_cmd_operationrs,

cCs�d}x_|dkrgt||�}|r=||krMdSn||krMdStjd�|d7}q	Wdj|�}|jd|�dS(Nii
iisOperation "{0}" FailedR(RRRRt	fail_json(Rtshow_cmdtcfg_cmdtpkgtpkg_not_presentRRterr((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytvalidate_operation�s
cCs9dj||�}t||�t||||t�|S(Nsinstall add {0}:{1}(RR R'R(RR"Rtfull_pkgR$R((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pyt
add_operation�s
cCs6dj|�}t||�t||||t�|S(Nsinstall activate {0} forced(RR R'R(RR"R$R((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytactivate_operation�s
cCs�d}|rdj|�}ndj|�}itd6}x�|dkr�t||gt|�}|r=t|dt�r�|ddkr�|Sq�t|dt�r�d|dj�ks�d|dj�kr�tjd	�|d
7}q�q�q=q=WdS(Nisinstall activate {0} forcedsinstall deactivate {0} forcedtignore_timeouti
i����s(another install operation is in progressRii(	RRRt
isinstancetinttstrRRR(RR$tflagRRtoptsR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytactivate_reload�s
,
cCs6dj|�}t||�t||||t�|S(Nsinstall commit {0}(RR R'R(RR"R$R((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytcommit_operation�s
cCs6dj|�}t||�t|||||�|S(Nsinstall deactivate {0} forced(RR R'(RR"R$R/R((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytdeactivate_operation�s
cCs6dj|�}t||�t||||t�|S(Nsinstall remove {0} forced(RR R'R(RR"R$R((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytremove_operation�s
cCs}g}t}|jd�}dj|dd!�}d}d}	d}
d}dj|�}|d	kr�t||�}
t|	|�}||
kr�||kr�|jt|||||��nt||�}|r�d
|kr�t}n||kr1|r|jt||t��|S|jt	||	|��nt|
|�}||kryt||�}||kr�|jt
||	|��q�dj|�}|jd|�qyn�t|
|�}t|	|�}t||�}|r�d
|kr�t}n||kr�||kr�|r+|jt||t��|S|jt||	|t��t|
|�}||kr~|jt
|||��n|jt
|||��n�||kr�|jt
|||��|jt
|||��n�||krB|r
|jt||t��|S|jt|||t��|jt
|||��n7t||�}
||
kry|jt
|||��n|S(
Nt.ii����sshow install inactivesshow install activesshow install committedsshow install patchessshow install pkg-info {0}tpresentsPatch Type    :  reloads.Operation "install activate {0} forced" FailedR(RtsplittjoinRRtappendR)RR1R*R2R!R3R4(RR(Rtstatetcommandstreload_patchtsplitted_pkgR$t
show_inactivetshow_activetshow_committshow_patchest
show_pkg_infot
inactive_bodytactive_bodytpatch_type_bodytcommit_bodyt
patch_bodyR&((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytinstall_remove_rpm�sp"		cCs~tdtdd�dtdddd�dtdd	d
gdd
��}t|�}tdt�|d<t|�tdtdd
ddd|��}|j|�|jt�ddgg}ddgg}td|d|d|dt�}t�}itd6gd6|d6}|j	j
d�}g}	|r�x�|D]Y}
x7|
D]/}|
j
|�dkrD|j	||
|<qDqDW|
j�}|	j
|�q7Wn7|	j
i|j	dd6|j	dd6|j	dd6�x�|	D]�}
|
dd
kr$t||
dd|
d�}|s$|jdd�q$nt||
d|
d|
d�}|r�t|d<|dj|�q�q�W|j|�dS(NR$ttypeR.Rtdefaultt	bootflashR:tchoicestabsentR6trequiredt	aggregatetlisttelementstdicttoptionst
argument_spectrequired_one_oftmutually_exclusivetsupports_check_modetchangedR;twarningsRs1The requested package doesn't exist on the device(RRRRRtupdateRR
RRPtparamstgettNonetcopyR9RR!RHtextendt	exit_json(telement_spectaggregate_specRTRURVRRYtresultsROtobjectstitemtkeytdtobjt
remote_existsR((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pytmainsV


		

	
	
!
t__main__(tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNRR^Rt&ansible.module_utils.network.nxos.nxosRRRR	tansible.module_utils.basicR
t)ansible.module_utils.network.common.utilsRRRR R'R)R*R1R2R3R4RHRjt__name__(((sI/usr/lib/python2.7/site-packages/ansible/modules/network/nxos/nxos_rpm.pyt<module>s2


)
											U	B

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