Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/module_utils/network/panos/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pyo

�
�Udac@`s)ddlmZmZmZeZdZeZy�ddl	Z	ddl
mZddlm
Z
ddlmZmZmZddlmZmZmZddlmZdd	lmZWnek
r�eZnXd
�Zdefd��YZdddddddeeddddddd
�Z dS(i(tabsolute_importtdivisiontprint_functions){0} version ({1}) < minimum version ({2})N(t	PanDevice(tFirewall(tDeviceGrouptTemplatet
TemplateStack(tPreRulebasetPostRulebasetRulebase(tVsys(tPanDeviceErrorcC`s
dj|�S(Ns{0}.{1}.{2}(tformat(tval((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pyt_vstr.stConnectionHelpercB`seZd�Zd�ZRS(cC`s�i|_g|_d|_d|_d|_d|_d|_d|_d|_	||_
||_||_||_
d|_dS(s9Performs connection initialization and determines params.N(t
argument_spectrequired_one_oftNonetvsystdevice_grouptvsys_dgtrulebasettemplatettemplate_stacktvsys_importabletmin_pandevice_versiontmin_panos_versiontpanorama_errortfirewall_errortdevice(tselfRRRR((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pyt__init__3s													c
C`s�ts|jdd�n|jd"k	r�td�tjjd�D��}||jkr�|jdtj	dtjt
|j���q�nd#\}}|jdr|jddr|jdd|jdd|jdd	|jdd
|jddf}|jdd}n||jjdd"�d"k	r�|jd|jd|jd	|jd
|jdf}d
}|j
|d�n|jdd�ytj|�|_Wn,tk
r�}|jddj	|��nX|jd"k	r3|jj|jkr3|jdtj	dt
|jj�t
|j���q3nt|jd�rv|rvtd|�}|jj|�||_n|j}d}	d}
d}t|jd�rT|jd"k	r�|jd|j�nt}t}
|jd"k	r�|j|j}|d"k	rctj|dt�}x�|D]%}|j|kr|}t}
PqqW|jd|	j	d|��q�|jd"k	r{t}q�|jd|
j	|j��n|jd"k	r�|j|j}|d"k	rE|
r�|jd|j	d��ntj|dt�}x�|D]}|j|kr|}PqqW|jd|	j	d|��q�|rg|jd|j	d��q�|jd|
j	|j��n|j p�|j!}|d"k	r�|j|}|d$kr�t"|�}|j|�|}q�n|j#p�|j$}|d"k	rz|j|}|d%krzt%j|dt�}xF|D]}|j|kr5|}Pq5q5W|jd|	j	d|��qzn|j&d"k	r�|j|j&d&kr�t'�}|j|�|}qQ|j|j&dkr�t(�}|j|�|}qQ|j|j&d kr(t)�}|j|�|}qQ|jd|	j	d!|j|j&��q�n�|j*d"k	ry|jd|j*�n|j#p�|j!p�|j }|d"k	r�|j||_!n|j&d"k	r�t(�}|j|�|}n|S('sdBuilds the pandevice object tree, returning the parent object.

        If pandevice is not installed, then module.fail_json() will be
        invoked.

        Arguments:
            * module(AnsibleModule): the ansible module.

        Returns:
            * The parent pandevice object based on the spec given to
              get_connection().
        tmsgs%Missing required library "pandevice".cs`s|]}t|�VqdS(N(tint(t.0tx((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pys	<genexpr>]st.t	pandevicetprovidert
ip_addresstusernametpasswordtapi_keytportt
serial_numbers>Classic provider params are deprecated; use "provider" insteads2.12sProvider params are required.sFailed connection: {0}sPAN-OStrefresh_devicestserials{0} "{1}" is not present.s7Param "{0}" is required for Panorama but not specified.s5Specify either the template or the template stack{0}.t	name_onlysTemplate stacks
, not bothRttsharedsDevice groupspre-rulebaseRs
post-rulebaseR
N(NN(NR3(NR3(Nspre-rulebase(+t
HAS_PANDEVICEt	fail_jsonRRttupleR't__version__tsplitt_MIN_VERSION_ERRORR
Rtparamstgett	deprecateRtcreate_from_deviceRRRt
_version_infothasattrRtaddRtFalseRRt
refreshalltTruetnameRRRRRRRRRRR
R	R(R tmoduletpdvtpan_device_authR.R"tetfwtparentt	not_foundtpano_mia_paramtts_errort
tmpl_requiredtadded_templateRDtstacksttst	templatesttt	vsys_nametvotdg_nametgroupstdgtrb((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pytget_pandevice_parentJs�"	



	
	




	
		
		
		
	(t__name__t
__module__R!RZ(((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pyR2s	cC`s
t|||
|�}g}iitd6dd6ddggd6iitd6d6idd	6d
6itd6d6itd6d6idd	6d
d6d6itd6d6d6d6}|r\t|dd<t|dddd<|dd=|jiitd6d6idd	6d
6itd6d6itd6d6idd	6d
d6d6�|jddgdddgg�n|r�idd	6ddgd6|d<n|d"k	r�t|t�r�d}n|}i||<||_n�|d"k	r
t|t�r�d}n|}idd	6||<||_	n|d"k	rQt|t�r.d}n|}idd	6||<||_
n|d"k	r�|d"k	rxtd��nt|t�r�d}n|}i||<||_n|d"k	rt|t�r�d}n|}id"d	6dddgd6||<||_
n|d"k	rCt|t�r'd}n|}i||<||_n|d"k	r�t|t�rgd }n|}i||<||_n|	d"k	r�xI|	j�D]8}||kr�td!j|���n|	|||<q�Wn|
d"k	r�|j|
�n||_||_|S(#sbReturns a helper object that handles pandevice object tree init.

    The `vsys`, `device_group`, `vsys_dg`, `vsys_importable`, `rulebase`,
    `template`, and `template_stack` params can be any of the following types:

        * None - do not include this in the spec
        * True - use the default param name
        * string - use this string for the param name

    The `min_pandevice_version` and `min_panos_version` args expect a 3 element
    tuple of ints.  For example, `(0, 6, 0)` or `(8, 1, 0)`.

    If you are including template support (by defining either `template` and/or
    `template_stack`), and the thing the module is enabling the management of is
    an "importable", you should define either `vsys_importable` (whose default
    value is None) or `vsys` (whose default value is 'vsys1').

    Arguments:
        vsys: The vsys (default: 'vsys1').
        device_group: Panorama only - The device group (default: 'shared').
        vsys_dg: The param name if vsys and device_group are a shared param.
        vsys_importable: Either this or `vsys` should be specified.  For:
            - Interfaces
            - VLANs
            - Virtual Wires
            - Virtual Routers
        rulebase: This is a policy of some sort.
        template: Panorama - The template name.
        template_stack: Panorama - The template stack name.
        with_classic_provider_spec(bool): Include the ip_address, username,
            password, api_key, and port params in the base spec, and make the
            "provider" param optional.
        with_state(bool): Include the standard 'state' param.
        argument_spec(dict): The argument spec to mixin with the
            generated spec based on the given parameters.
        required_one_of(list): List of lists to extend into required_one_of.
        min_pandevice_version(tuple): Minimum pandevice version allowed.
        min_panos_version(tuple): Minimum PAN-OS version allowed.
        panorama_error(str): The error message if the device is Panorama.
        firewall_error(str): The error message if the device is a firewall.

    Returns:
        ConnectionHelper
    trequiredtdictttypeR+R,RR)tadmintdefaultR*tno_logi�R#R-R.toptionsR(tpresenttabsenttchoiceststateRRtvsys1RR3s-Define "vsys" or "vsys_importable", not both.Rspre-rulebases
post-rulebaseRRs#{0}: key used by connection helper.N(RRCRAtupdatetextendRt
isinstancetboolRRRtKeyErrorRRRRtkeysR
RR(RRRRRRRtwith_classic_provider_spect
with_stateRRRRRRthelpertreqtspectparamtk((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pytget_connection�s�3			
			
		
	
		(!t
__future__RRRR_t
__metaclass__R9RCR4R'tpandevice.baseRtpandevice.firewallRtpandevice.panoramaRRRtpandevice.policiesRR	R
tpandevice.deviceRtpandevice.errorsRtImportErrorRARtobjectRRRv(((sL/usr/lib/python2.7/site-packages/ansible/module_utils/network/panos/panos.pyt<module>s,

	�	

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