Merge pull request #33562 from jfindlay/apache_funcs

states.apache_*: readd and deprecate enable and disable
This commit is contained in:
Mike Place 2016-06-02 12:51:37 -07:00
commit 5f4c6902aa
4 changed files with 104 additions and 4 deletions

View file

@ -247,6 +247,19 @@ Module Changes
- Tree: Used to return {} on key-not-found. Now returns None.
- :mod:`smartos_virt execution module <salt.modules.smartos_virt>`: Updated to
use most of the new smartos_vmadm (:pull:`28284`).
- :mod:`apache_conf state module <salt.states.apache_conf>`,
:mod:`apache_module state module <salt.states.apache_module>`, and
:mod:`apache_site state module <salt.states.apache_site>`: the ``enable`` and
``disable`` functions were renamed to ``enabled`` and ``disabled``,
respectively. In :pull:`33562`, these functions were readded and properly
deprecated and will be removed in Salt Nitrogen. This fix will be available
in 2016.3.1. As a workaround, try
.. code-block:: sls
apache_module.enable{{ 'd' if grains.saltversioninfo == [2016, 3, 0] else '' }}
New Features
============

View file

@ -9,11 +9,11 @@ Enable and disable apache confs.
.. code-block:: yaml
Enable security conf:
apache_conf.enable:
apache_conf.enabled:
- name: security
Disable security conf:
apache_conf.disable:
apache_conf.disabled:
- name: security
'''
from __future__ import absolute_import
@ -64,6 +64,25 @@ def enabled(name):
return ret
def enable(name):
'''
Ensure an Apache conf is enabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache conf
'''
salt.utils.warn_until(
'Nitrogen',
'apache_module.enable function has been renamed'
' apache_module.enabled and will be removed in Salt Nitrogen'
)
return enabled(name)
def disabled(name):
'''
Ensure an Apache conf is disabled.
@ -96,3 +115,22 @@ def disabled(name):
else:
ret['comment'] = '{0} already disabled.'.format(name)
return ret
def disable(name):
'''
Ensure an Apache conf is disabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache conf
'''
salt.utils.warn_until(
'Nitrogen',
'apache_module.disable function has been renamed'
' apache_module.disabled and will be removed in Salt Nitrogen'
)
return disabled(name)

View file

@ -68,6 +68,10 @@ def enable(name):
'''
Ensure an Apache module is enabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache module
'''
@ -118,6 +122,10 @@ def disable(name):
'''
Ensure an Apache module is disabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache module
'''

View file

@ -9,16 +9,19 @@ Enable and disable apache sites.
.. code-block:: yaml
Enable default site:
apache_site.enable:
apache_site.enabled:
- name: default
Disable default site:
apache_site.disable:
apache_site.disabled:
- name: default
'''
from __future__ import absolute_import
from salt.ext.six import string_types
# Import salt libs
import salt.utils
def __virtual__():
'''
@ -61,6 +64,25 @@ def enabled(name):
return ret
def enable(name):
'''
Ensure an Apache site is enabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache site
'''
salt.utils.warn_until(
'Nitrogen',
'apache_module.enable function has been renamed'
' apache_module.enabled and will be removed in Salt Nitrogen'
)
return enabled(name)
def disabled(name):
'''
Ensure an Apache site is disabled.
@ -93,3 +115,22 @@ def disabled(name):
else:
ret['comment'] = '{0} already disabled.'.format(name)
return ret
def disable(name):
'''
Ensure an Apache site is disabled.
.. warning::
This function is deprecated and will be removed in Salt Nitrogen.
name
Name of the Apache site
'''
salt.utils.warn_until(
'Nitrogen',
'apache_module.disable function has been renamed'
' apache_module.disabled and will be removed in Salt Nitrogen'
)
return disabled(name)