%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/deb_apache.pyo

�
���^c@@sdZddlmZmZmZddlZddlZddlZddl	Zej
e�ZdZ
dZd�Zd�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zejjjjd�d��Zejjjjd�d��ZdS(u�
Support for Apache

Please note: The functions in here are Debian-specific. Placing them in this
separate file will allow them to load only on Debian-based systems, while still
loading under the ``apache`` namespace.
i(tabsolute_importtprint_functiontunicode_literalsNuapacheu/etc/apache2/sites-enabledcC@s<t�}tjjj|�r2tddkr2tStdfS(u5
    Only load the module if apache is installed
    u	os_familyuDebianu9apache execution module not loaded: apache not installed.(t
_detect_ostsalttutilstpathtwhicht
__grains__t__virtualname__tFalse(tcmd((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyt__virtual__s	%cC@s0tddkrdStddkr(dSdSdS(uA
    Apache commands and paths differ depending on packaging
    u	os_familyuRedHatu	apachectluDebianu
apache2ctlN(R(((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyR$s
cC@s|jd�r|}ndj|�}tjjdjt|��rItS|dkrwtjjdjt|��rwtStSdS(uT
    Checks to see if the specific site symlink is in /etc/apache2/sites-enabled.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.check_site_enabled example.com
        salt '*' apache.check_site_enabled example.com.conf
    u.confu{0}.confu{0}/{1}udefaultu{0}/000-{1}N(tendswithtformattosRtislinktSITE_ENABLED_DIRtTrueR
(tsitet	site_file((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pytcheck_site_enabled1s	cC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u�
    Runs a2ensite for the given site.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2ensite example.com
    ua2ensiteucmd.retcodetpython_shelluApache2 Enable SiteuNameuSiteiuSite {0} Not founduStatusiuSite {0} enabled(t__salt__R
t	ExceptionR(Rtrettcommandtstatuste((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyta2ensiteLs



cC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u�
    Runs a2dissite for the given site.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2dissite example.com
    u	a2dissiteucmd.retcodeRuApache2 Disable SiteuNameuSiteiuSite {0} Not founduStatusiuSite {0} disabled(RR
RR(RRRRR((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyt	a2dissitens



cC@sO|jd�s|jd�r'|}ndj|�}tjjdj|��S(u|
    Checks to see if the specific mod symlink is in /etc/apache2/mods-enabled.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.check_mod_enabled status
        salt '*' apache.check_mod_enabled status.load
        salt '*' apache.check_mod_enabled status.conf
    u.loadu.confu{0}.loadu/etc/apache2/mods-enabled/{0}(R
RRRR(tmodtmod_file((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pytcheck_mod_enabled�s	cC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u�
    Runs a2enmod for the given mod.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2enmod vhost_alias
    ua2enmoducmd.retcodeRuApache2 Enable ModuNameuModiuMod {0} Not founduStatusiuMod {0} enabled(RR
RR(RRRRR((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyta2enmod�s



cC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u�
    Runs a2dismod for the given mod.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2dismod vhost_alias
    ua2dismoducmd.retcodeRuApache2 Disable ModuNameuModiuMod {0} Not founduStatusiuMod {0} disabled(RR
RR(RRRRR((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyta2dismod�s



cC@s@|jd�r|}ndj|�}tjjdj|��S(um
    .. versionadded:: 2016.3.0

    Checks to see if the specific conf symlink is in /etc/apache2/conf-enabled.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.check_conf_enabled security
        salt '*' apache.check_conf_enabled security.conf
    u.confu{0}.confu/etc/apache2/conf-enabled/{0}(R
RRRR(tconft	conf_file((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pytcheck_conf_enabled�s	ua2enconfcC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u
    .. versionadded:: 2016.3.0

    Runs a2enconf for the given conf.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2enconf security
    ua2enconfucmd.retcodeRuApache2 Enable ConfuNameuConfiuConf {0} Not founduStatusiuConf {0} enabled(RR
RR(R$RRRR((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyta2enconfs


u	a2disconfcC@s�i}d|g}ytd|dt�}Wntk
rB}|SXd|d<||d<|dkrydj|�|d	<n,|d
kr�dj|�|d	<n
||d	<|S(u
    .. versionadded:: 2016.3.0

    Runs a2disconf for the given conf.

    This will only be functional on Debian-based operating systems (Ubuntu,
    Mint, etc).

    CLI Examples:

    .. code-block:: bash

        salt '*' apache.a2disconf security
    u	a2disconfucmd.retcodeRuApache2 Disable ConfuNameuConfiuConf {0} Not founduStatusiuConf {0} disabled(RR
RR(R$RRRR((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyt	a2disconf&s


(t__doc__t
__future__RRRRtloggingtsalt.utils.decorators.pathRtsalt.utils.patht	getLoggert__name__tlogR	RRRRRRR!R"R#R&Rt
decoratorsRRR'R((((s;/usr/lib/python2.7/site-packages/salt/modules/deb_apache.pyt<module>s&	
	
		"	"		"	"	!%

Zerion Mini Shell 1.0