Updated apache_module for backward compatible.

[This](f3a2b27671) introduced
a change of functions names that break this module when using Beryllium or older and upgrading to Boron.
Added here a deprecated warning in to order to advice users to migrate to new functions names. Also
documentation updated since was not updated in the original commit.
This commit is contained in:
abednarik 2016-05-29 17:23:27 -03:00
parent a466fffc70
commit 7d096f7954

View File

@ -9,16 +9,19 @@ Enable and disable apache modules.
.. code-block:: yaml
Enable cgi module:
apache_module.enable:
apache_module.enabled:
- name: cgi
Disable cgi module:
apache_module.disable:
apache_module.disabled:
- name: cgi
'''
from __future__ import absolute_import
from salt.ext.six import string_types
# Import salt libs
import salt.utils
def __virtual__():
'''
@ -61,6 +64,22 @@ def enabled(name):
return ret
def enable(name):
'''
Ensure an Apache module is enabled.
name
Name of the Apache module
'''
salt.utils.warn_until(
'Carbon',
'This functionality has been deprecated; use "apache_module.enabled" '
'instead.'
)
return enabled(name)
def disabled(name):
'''
Ensure an Apache module is disabled.
@ -93,3 +112,19 @@ def disabled(name):
else:
ret['comment'] = '{0} already disabled.'.format(name)
return ret
def disable(name):
'''
Ensure an Apache module is disabled.
name
Name of the Apache module
'''
salt.utils.warn_until(
'Carbon',
'This functionality has been deprecated; use "apache_module.disabled" '
'instead.'
)
return disabled(name)