Merge pull request #33457 from rallytime/doc-formatting

Make doc formatting consistent and use correct versionadded
This commit is contained in:
Mike Place 2016-05-24 10:52:33 -07:00
commit b8154b678e

View File

@ -10,16 +10,19 @@ file on the minions, by default at: /etc/salt/grains
Note: This does NOT override any grains set in the minion file. Note: This does NOT override any grains set in the minion file.
''' '''
# Import Python libs
from __future__ import absolute_import from __future__ import absolute_import
from salt.defaults import DEFAULT_TARGET_DELIM
import re import re
# Import Salt libs
from salt.defaults import DEFAULT_TARGET_DELIM
def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False): def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False):
''' '''
Ensure that a grain is set Ensure that a grain is set
.. versionchanged:: Boron .. versionchanged:: v2015.8.2
name name
The grain name The grain name
@ -27,14 +30,16 @@ def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False):
value value
The value to set on the grain The value to set on the grain
:param force: If force is True, the existing grain will be overwritten force
If force is True, the existing grain will be overwritten
regardless of its existing or provided value type. Defaults to False regardless of its existing or provided value type. Defaults to False
.. versionadded:: Boron .. versionadded:: v2015.8.2
:param delimiter: A delimiter different from the default can be provided. delimiter
A delimiter different from the default can be provided.
.. versionadded:: Boron .. versionadded:: v2015.8.2
It is now capable to set a grain to a complex value (ie. lists and dicts) It is now capable to set a grain to a complex value (ie. lists and dicts)
and supports nested grains as well. and supports nested grains as well.
@ -59,11 +64,11 @@ def present(name, value, delimiter=DEFAULT_TARGET_DELIM, force=False):
- name: icinga:Apache SSL - name: icinga:Apache SSL
- value: - value:
- command: check_https - command: check_https
- params: -H localhost -p 443 -S - params: -H localhost -p 443 -S
with,a,custom,delimiter: with,a,custom,delimiter:
grains.present: grains.present:
- value: yay - value: yay
- delimiter: , - delimiter: ,
''' '''
name = re.sub(delimiter, DEFAULT_TARGET_DELIM, name) name = re.sub(delimiter, DEFAULT_TARGET_DELIM, name)
@ -106,9 +111,10 @@ def list_present(name, value, delimiter=DEFAULT_TARGET_DELIM):
value value
The value is present in the list type grain. The value is present in the list type grain.
:param delimiter: A delimiter different from the default ``:`` can be provided. delimiter
A delimiter different from the default ``:`` can be provided.
.. versionadded:: Boron .. versionadded:: v2015.8.2
The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_ The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_
@ -198,9 +204,10 @@ def list_absent(name, value, delimiter=DEFAULT_TARGET_DELIM):
value value
The value to delete from the grain list. The value to delete from the grain list.
:param delimiter: A delimiter different from the default ``:`` can be provided. delimiter
A delimiter different from the default ``:`` can be provided.
.. versionadded:: Boron .. versionadded:: v2015.8.2
The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_ The grain should be `list type <http://docs.python.org/2/tutorial/datastructures.html#data-structures>`_
@ -273,19 +280,23 @@ def absent(name,
name name
The grain name The grain name
:param destructive: If destructive is True, delete the entire grain. If destructive
If destructive is True, delete the entire grain. If
destructive is False, set the grain's value to None. Defaults to False. destructive is False, set the grain's value to None. Defaults to False.
:param force: If force is True, the existing grain will be overwritten force
If force is True, the existing grain will be overwritten
regardless of its existing or provided value type. Defaults to False regardless of its existing or provided value type. Defaults to False
.. versionadded:: Boron .. versionadded:: v2015.8.2
:param delimiter: A delimiter different from the default can be provided. delimiter
A delimiter different from the default can be provided.
.. versionadded:: Boron .. versionadded:: v2015.8.2
.. versionchanged:: v2015.8.2
.. versionchanged:: Boron
This state now support nested grains and complex values. It is also more This state now support nested grains and complex values. It is also more
conservative: if a grain has a value that is a list or a dict, it will conservative: if a grain has a value that is a list or a dict, it will
not be removed unless the `force` parameter is True. not be removed unless the `force` parameter is True.
@ -367,13 +378,15 @@ def append(name, value, convert=False,
value value
The value to append The value to append
:param convert: If convert is True, convert non-list contents into a list. convert
If convert is True, convert non-list contents into a list.
If convert is False and the grain contains non-list contents, an error If convert is False and the grain contains non-list contents, an error
is given. Defaults to False. is given. Defaults to False.
:param delimiter: A delimiter different from the default can be provided. delimiter
A delimiter different from the default can be provided.
.. versionadded:: Boron .. versionadded:: v2015.8.2
.. code-block:: yaml .. code-block:: yaml