%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/apf.pyc

�
���^c@@s�dZddlmZmZmZyddlZeZWnek
rQe	ZnXddl
Zddlm
Z
d�Zd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zdd
�Zd�Zd�ZdS(u�
Support for Advanced Policy Firewall (APF)
==========================================
:maintainer: Mostafa Hussein <mostafa.hussein91@gmail.com>
:maturity: new
:depends: python-iptables
:platform: Linux
i(tabsolute_importtprint_functiontunicode_literalsN(tCommandExecutionErrorcC@s=tjjjd�dkr%tdfSts5tdfStSdS(u/
    Only load if apf exists on the system
    uapfu;The apf execution module cannot be loaded: apf unavailable.uFThe apf execution module cannot be loaded: python-iptables is missing.N(tsalttutilstpathtwhichtNonetFalset
IPTC_IMPORTEDtTrue(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pyt__virtual__scC@s�djtjjjd�|�}td|�}|ddkrz|dsX|d}n
|d}tdj|���n|dS(	u!
    Return the apf location
    u{0} {1}uapfucmd.run_alluretcodeiustderrustdoutuapf failed: {0}(tformatRRRRt__salt__R(tcmdtapf_cmdtouttmsg((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pyt	__apf_cmd's!


cC@s[d}tjtjj�}x/|jD]$}d|jj�kr%d}q%q%W|rWtStS(u>
    Return True if apf is running otherwise return False
    iusanityi(tiptctTabletFILTERtchainstnametlowerRR	(tstatusttabletchain((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pyt_status_apf9s
cC@st�r
tStS(uc
    Check apf status
    CLI Example:

    .. code-block:: bash

        salt '*' apf.running
    (RRR	(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytrunningEs	cC@st�rtd�SdS(ur
    Stop (flush) all firewall rules
    CLI Example:

    .. code-block:: bash

        salt '*' apf.disable
    u-fN(RR(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytdisableQs		cC@st�std�SdS(ui
    Load all firewall rules
    CLI Example:

    .. code-block:: bash

        salt '*' apf.enable
    u-sN(RR(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytenable^s		cC@st�std�SdS(uv
    Stop (flush) & reload firewall rules
    CLI Example:

    .. code-block:: bash

        salt '*' apf.reload
    u-rN(RR(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytreloadks		cC@s
td�S(u}
    Refresh & resolve dns names in trust rules
    CLI Example:

    .. code-block:: bash

        salt '*' apf.refresh
    u-e(R(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytrefreshxs	cC@s#|dkrtdj|��SdS(u�
    Add host (IP/FQDN) to allow_hosts.rules and immediately load new rule into firewall
    CLI Example:

    .. code-block:: bash

        salt '*' apf.allow 127.0.0.1
    u-a {0}N(RRR
(tiptport((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytallow�s	cC@stdj|��S(u�
    Add host (IP/FQDN) to deny_hosts.rules and immediately load new rule into firewall
    CLI Example:

    .. code-block:: bash

        salt '*' apf.deny 1.2.3.4
    u-d {0}(RR
(R#((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytdeny�s	cC@stdj|��S(u�
    Remove host from [glob]*_hosts.rules and immediately remove rule from firewall
    CLI Example:

    .. code-block:: bash

        salt '*' apf.remove 1.2.3.4
    u-u {0}(RR
(R#((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pytremove�s	(t__doc__t
__future__RRRRRR
tImportErrorR	tsalt.utils.pathRtsalt.exceptionsRRRRRRR R!R"RR%R&R'(((s4/usr/lib/python2.7/site-packages/salt/modules/apf.pyt<module>	s&


					
	
	
	
	

Zerion Mini Shell 1.0