Fix versionadded and/or versionchanged versions in docstrings

Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
Pedro Algarvio 2023-06-07 17:13:54 +01:00 committed by Megan Wilhite
parent e2a0161968
commit 5bed144177
29 changed files with 56 additions and 60 deletions

View file

@ -1046,7 +1046,7 @@ repos:
- repo: https://github.com/s0undt3ch/salt-rewrite - repo: https://github.com/s0undt3ch/salt-rewrite
# Automatically rewrite code with known rules # Automatically rewrite code with known rules
rev: 2.0.0 rev: 2.4.2
hooks: hooks:
- id: salt-rewrite - id: salt-rewrite
alias: rewrite-docstrings alias: rewrite-docstrings
@ -1058,10 +1058,6 @@ repos:
salt/ext/.* salt/ext/.*
)$ )$
- repo: https://github.com/s0undt3ch/salt-rewrite
# Automatically rewrite code with known rules
rev: 2.0.0
hooks:
- id: salt-rewrite - id: salt-rewrite
alias: rewrite-tests alias: rewrite-tests
name: Rewrite Salt's Test Suite name: Rewrite Salt's Test Suite

View file

@ -88,7 +88,7 @@ class DeferredStreamHandler(StreamHandler):
If anything goes wrong before logging is properly setup, all stored messages If anything goes wrong before logging is properly setup, all stored messages
will be flushed to the handler's stream, ie, written to console. will be flushed to the handler's stream, ie, written to console.
.. versionadded:: 3005.0 .. versionadded:: 3005
""" """
def __init__(self, stream, max_queue_size=10000): def __init__(self, stream, max_queue_size=10000):

View file

@ -3,7 +3,7 @@ Minion data cache plugin for Consul key/value data store.
.. versionadded:: 2016.11.2 .. versionadded:: 2016.11.2
.. versionchanged:: 3005.0 .. versionchanged:: 3005
Timestamp/cache updated support added. Timestamp/cache updated support added.

View file

@ -17,7 +17,7 @@ except ImportError:
def get(key, default="", merge=False, delimiter=DEFAULT_TARGET_DELIM): def get(key, default="", merge=False, delimiter=DEFAULT_TARGET_DELIM):
""" """
.. versionadded:: 0.14 .. versionadded:: 0.14.0
Attempt to retrieve the named value from pillar, if the named value is not Attempt to retrieve the named value from pillar, if the named value is not
available return the passed default. The default return is an empty string. available return the passed default. The default return is an empty string.

View file

@ -2,7 +2,7 @@
CenturyLink Cloud Module CenturyLink Cloud Module
======================== ========================
.. versionadded:: 2018.3 .. versionadded:: 2018.3.0
The CLC cloud module allows you to manage CLC Via the CLC SDK. The CLC cloud module allows you to manage CLC Via the CLC SDK.

View file

@ -2,7 +2,7 @@
Grains from cloud metadata servers at 169.254.169.254 in Grains from cloud metadata servers at 169.254.169.254 in
google compute engine google compute engine
.. versionadded:: 3005.0 .. versionadded:: 3005
:depends: requests :depends: requests

View file

@ -2,7 +2,7 @@
ACME / Let's Encrypt module ACME / Let's Encrypt module
=========================== ===========================
.. versionadded:: 2016.3 .. versionadded:: 2016.3.0
This module currently looks for certbot script in the $PATH as This module currently looks for certbot script in the $PATH as
- certbot, - certbot,

View file

@ -3506,7 +3506,7 @@ def _get_http_proxy_url():
def list_downloaded(root=None, **kwargs): def list_downloaded(root=None, **kwargs):
""" """
.. versionadded:: 3000? .. versionadded:: 3000
List prefetched packages downloaded by apt in the local disk. List prefetched packages downloaded by apt in the local disk.

View file

@ -1019,7 +1019,7 @@ def clone(
https_user https_user
Set HTTP Basic Auth username. Only accepted for HTTPS URLs. Set HTTP Basic Auth username. Only accepted for HTTPS URLs.
.. versionadded:: 20515.5.0 .. versionadded:: 2015.5.0
https_pass https_pass
Set HTTP Basic Auth password. Only accepted for HTTPS URLs. Set HTTP Basic Auth password. Only accepted for HTTPS URLs.

View file

@ -89,7 +89,7 @@ def get_str(
): ):
""" """
.. versionadded:: 2014.7.0 .. versionadded:: 2014.7.0
.. versionchanged:: 3004.0 .. versionchanged:: 3004
Changed the default character set used to include symbols and implemented arguments to control the used character set. Changed the default character set used to include symbols and implemented arguments to control the used character set.
@ -99,14 +99,14 @@ def get_str(
Any valid number of bytes. Any valid number of bytes.
chars : None chars : None
.. versionadded:: 3004.0 .. versionadded:: 3004
String with any character that should be used to generate random string. String with any character that should be used to generate random string.
This argument supersedes all other character controlling arguments. This argument supersedes all other character controlling arguments.
lowercase : True lowercase : True
.. versionadded:: 3004.0 .. versionadded:: 3004
Use lowercase letters in generated random string. Use lowercase letters in generated random string.
(see :py:data:`string.ascii_lowercase`) (see :py:data:`string.ascii_lowercase`)
@ -114,7 +114,7 @@ def get_str(
This argument is superseded by chars. This argument is superseded by chars.
uppercase : True uppercase : True
.. versionadded:: 3004.0 .. versionadded:: 3004
Use uppercase letters in generated random string. Use uppercase letters in generated random string.
(see :py:data:`string.ascii_uppercase`) (see :py:data:`string.ascii_uppercase`)
@ -122,7 +122,7 @@ def get_str(
This argument is superseded by chars. This argument is superseded by chars.
digits : True digits : True
.. versionadded:: 3004.0 .. versionadded:: 3004
Use digits in generated random string. Use digits in generated random string.
(see :py:data:`string.digits`) (see :py:data:`string.digits`)
@ -130,7 +130,7 @@ def get_str(
This argument is superseded by chars. This argument is superseded by chars.
printable : False printable : False
.. versionadded:: 3004.0 .. versionadded:: 3004
Use printable characters in generated random string and includes lowercase, uppercase, Use printable characters in generated random string and includes lowercase, uppercase,
digits, punctuation and whitespace. digits, punctuation and whitespace.
@ -143,7 +143,7 @@ def get_str(
This argument is superseded by chars. This argument is superseded by chars.
punctuation : True punctuation : True
.. versionadded:: 3004.0 .. versionadded:: 3004
Use punctuation characters in generated random string. Use punctuation characters in generated random string.
(see :py:data:`string.punctuation`) (see :py:data:`string.punctuation`)
@ -151,7 +151,7 @@ def get_str(
This argument is superseded by chars. This argument is superseded by chars.
whitespace : False whitespace : False
.. versionadded:: 3004.0 .. versionadded:: 3004
Use whitespace characters in generated random string. Use whitespace characters in generated random string.
(see :py:data:`string.whitespace`) (see :py:data:`string.whitespace`)

View file

@ -193,11 +193,11 @@ def bridge_create(br, may_exist=True, parent=None, vlan=None):
parent : string parent : string
name of the parent bridge (if the bridge shall be created as a fake name of the parent bridge (if the bridge shall be created as a fake
bridge). If specified, vlan must also be specified. bridge). If specified, vlan must also be specified.
.. versionadded:: 3006 .. versionadded:: 3006.0
vlan : int vlan : int
VLAN ID of the bridge (if the bridge shall be created as a fake VLAN ID of the bridge (if the bridge shall be created as a fake
bridge). If specified, parent must also be specified. bridge). If specified, parent must also be specified.
.. versionadded:: 3006 .. versionadded:: 3006.0
Returns: Returns:
True on success, else False. True on success, else False.
@ -252,7 +252,7 @@ def bridge_delete(br, if_exists=True):
def bridge_to_parent(br): def bridge_to_parent(br):
""" """
.. versionadded:: 3006 .. versionadded:: 3006.0
Returns the parent bridge of a bridge. Returns the parent bridge of a bridge.
@ -280,7 +280,7 @@ def bridge_to_parent(br):
def bridge_to_vlan(br): def bridge_to_vlan(br):
""" """
.. versionadded:: 3006 .. versionadded:: 3006.0
Returns the VLAN ID of a bridge. Returns the VLAN ID of a bridge.
@ -599,7 +599,7 @@ def port_create_vxlan(br, port, id, remote, dst_port=None):
def db_get(table, record, column, if_exists=False): def db_get(table, record, column, if_exists=False):
""" """
.. versionadded:: 3006 .. versionadded:: 3006.0
Gets a column's value for a specific record. Gets a column's value for a specific record.
@ -638,7 +638,7 @@ def db_get(table, record, column, if_exists=False):
def db_set(table, record, column, value, if_exists=False): def db_set(table, record, column, value, if_exists=False):
""" """
.. versionadded:: 3006 .. versionadded:: 3006.0
Sets a column's value for a specific record. Sets a column's value for a specific record.

View file

@ -32,7 +32,7 @@ def get(
saltenv=None, saltenv=None,
): ):
""" """
.. versionadded:: 0.14 .. versionadded:: 0.14.0
Attempt to retrieve the named value from :ref:`in-memory pillar data Attempt to retrieve the named value from :ref:`in-memory pillar data
<pillar-in-memory>`. If the pillar key is not present in the in-memory <pillar-in-memory>`. If the pillar key is not present in the in-memory

View file

@ -545,7 +545,7 @@ def delete(name, **kwargs):
""" """
Delete the named service Delete the named service
.. versionadded:: 2016.3 .. versionadded:: 2016.3.0
CLI Example: CLI Example:

View file

@ -546,7 +546,7 @@ def list_state_functions(*args, **kwargs): # pylint: disable=unused-argument
salt '*' sys.list_state_functions 'file.*' salt '*' sys.list_state_functions 'file.*'
salt '*' sys.list_state_functions 'file.s*' salt '*' sys.list_state_functions 'file.s*'
.. versionadded:: 2016.9 .. versionadded:: 2016.9.0
.. code-block:: bash .. code-block:: bash

View file

@ -755,7 +755,7 @@ def join_domain(
``True`` will restart the computer after a successful join. Default ``True`` will restart the computer after a successful join. Default
is ``False`` is ``False``
.. versionadded:: 2015.8.2/2015.5.7 .. versionadded:: 2015.5.7,2015.8.2
Returns: Returns:
dict: Returns a dictionary if successful, otherwise ``False`` dict: Returns a dictionary if successful, otherwise ``False``
@ -889,7 +889,7 @@ def unjoin_domain(
workgroup (str): workgroup (str):
The workgroup to join the computer to. Default is ``WORKGROUP`` The workgroup to join the computer to. Default is ``WORKGROUP``
.. versionadded:: 2015.8.2/2015.5.7 .. versionadded:: 2015.5.7,2015.8.2
disable (bool): disable (bool):
``True`` to disable the computer account in Active Directory. ``True`` to disable the computer account in Active Directory.
@ -899,7 +899,7 @@ def unjoin_domain(
``True`` will restart the computer after successful unjoin. Default ``True`` will restart the computer after successful unjoin. Default
is ``False`` is ``False``
.. versionadded:: 2015.8.2/2015.5.7 .. versionadded:: 2015.5.7,2015.8.2
Returns: Returns:
dict: Returns a dictionary if successful, otherwise ``False`` dict: Returns a dictionary if successful, otherwise ``False``

View file

@ -1905,7 +1905,7 @@ def upgrade(
Disable exclude from main, for a repo or for everything. Disable exclude from main, for a repo or for everything.
(e.g., ``yum --disableexcludes='main'``) (e.g., ``yum --disableexcludes='main'``)
.. versionadded:: 2014.7 .. versionadded:: 2014.7.0
name name
The name of the package to be upgraded. Note that this parameter is The name of the package to be upgraded. Note that this parameter is
@ -2446,7 +2446,7 @@ def unhold(name=None, pkgs=None, sources=None, **kwargs): # pylint: disable=W06
def list_holds(pattern=__HOLD_PATTERN, full=True): def list_holds(pattern=__HOLD_PATTERN, full=True):
r""" r"""
.. versionchanged:: 2016.3.0,2015.8.4,2015.5.10 .. versionchanged:: 2015.5.10,2015.8.4,2016.3.0
Function renamed from ``pkg.get_locked_pkgs`` to ``pkg.list_holds``. Function renamed from ``pkg.get_locked_pkgs`` to ``pkg.list_holds``.
List information on locked packages List information on locked packages
@ -2573,7 +2573,7 @@ def group_list():
def group_info(name, expand=False, ignore_groups=None): def group_info(name, expand=False, ignore_groups=None):
""" """
.. versionadded:: 2014.1.0 .. versionadded:: 2014.1.0
.. versionchanged:: 3001,2016.3.0,2015.8.4,2015.5.10 .. versionchanged:: 2015.5.10,2015.8.4,2016.3.0,3001
The return data has changed. A new key ``type`` has been added to The return data has changed. A new key ``type`` has been added to
distinguish environment groups from package groups. Also, keys for the distinguish environment groups from package groups. Also, keys for the
group name and group ID have been added. The ``mandatory packages``, group name and group ID have been added. The ``mandatory packages``,
@ -2683,7 +2683,7 @@ def group_info(name, expand=False, ignore_groups=None):
def group_diff(name): def group_diff(name):
""" """
.. versionadded:: 2014.1.0 .. versionadded:: 2014.1.0
.. versionchanged:: 2016.3.0,2015.8.4,2015.5.10 .. versionchanged:: 2015.5.10,2015.8.4,2016.3.0
Environment groups are now supported. The key names have been renamed, Environment groups are now supported. The key names have been renamed,
similar to the changes made in :py:func:`pkg.group_info similar to the changes made in :py:func:`pkg.group_info
<salt.modules.yumpkg.group_info>`. <salt.modules.yumpkg.group_info>`.

View file

@ -146,7 +146,7 @@ def _query(method, params, url, auth=None):
:return: Response from API with desired data in JSON format. In case of error returns more specific description. :return: Response from API with desired data in JSON format. In case of error returns more specific description.
.. versionchanged:: 2017.7 .. versionchanged:: 2017.7.0
""" """
unauthenticated_methods = [ unauthenticated_methods = [
@ -311,7 +311,7 @@ def _map_to_list_of_dicts(source, key):
def get_zabbix_id_mapper(): def get_zabbix_id_mapper():
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Make ZABBIX_ID_MAPPER constant available to state modules. Make ZABBIX_ID_MAPPER constant available to state modules.
@ -328,7 +328,7 @@ def get_zabbix_id_mapper():
def substitute_params(input_object, extend_params=None, filter_key="name", **kwargs): def substitute_params(input_object, extend_params=None, filter_key="name", **kwargs):
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back Go through Zabbix object params specification and if needed get given object ID from Zabbix API and put it back
as a value. Definition of the object is done via dict with keys "query_object" and "query_name". as a value. Definition of the object is done via dict with keys "query_object" and "query_name".
@ -385,7 +385,7 @@ def substitute_params(input_object, extend_params=None, filter_key="name", **kwa
# pylint: disable=too-many-return-statements,too-many-nested-blocks # pylint: disable=too-many-return-statements,too-many-nested-blocks
def compare_params(defined, existing, return_old_value=False): def compare_params(defined, existing, return_old_value=False):
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Compares Zabbix object definition against existing Zabbix object. Compares Zabbix object definition against existing Zabbix object.
@ -471,7 +471,7 @@ def compare_params(defined, existing, return_old_value=False):
def get_object_id_by_params(obj, params=None, **connection_args): def get_object_id_by_params(obj, params=None, **connection_args):
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Get ID of single Zabbix object specified by its name. Get ID of single Zabbix object specified by its name.
@ -2703,7 +2703,7 @@ def run_query(method, params, **connection_args):
def configuration_import(config_file, rules=None, file_format="xml", **connection_args): def configuration_import(config_file, rules=None, file_format="xml", **connection_args):
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Imports Zabbix configuration specified in file to Zabbix server. Imports Zabbix configuration specified in file to Zabbix server.

View file

@ -56,28 +56,28 @@ site_prefixes: ``True``
Whether should retrieve the prefixes of the site the device belongs to. Whether should retrieve the prefixes of the site the device belongs to.
devices: ``True`` devices: ``True``
.. versionadded:: 3004.0 .. versionadded:: 3004
Whether should retrieve physical devices. Whether should retrieve physical devices.
virtual_machines: ``False`` virtual_machines: ``False``
.. versionadded:: 3004.0 .. versionadded:: 3004
Whether should retrieve virtual machines. Whether should retrieve virtual machines.
interfaces: ``False`` interfaces: ``False``
.. versionadded:: 3004.0 .. versionadded:: 3004
Whether should retrieve the interfaces of the device. Whether should retrieve the interfaces of the device.
interface_ips: ``False`` interface_ips: ``False``
.. versionadded:: 3004.0 .. versionadded:: 3004
Whether should retrieve the IP addresses for interfaces of the device. Whether should retrieve the IP addresses for interfaces of the device.
(interfaces must be set to True as well) (interfaces must be set to True as well)
api_query_result_limit: ``Use NetBox default`` api_query_result_limit: ``Use NetBox default``
.. versionadded:: 3004.0 .. versionadded:: 3004
An integer specifying how many results should be returned for each query An integer specifying how many results should be returned for each query
to the NetBox API. Leaving this unset will use NetBox's default value. to the NetBox API. Leaving this unset will use NetBox's default value.

View file

@ -86,7 +86,7 @@ def orchestrate(
Runner uses the pillar variable Runner uses the pillar variable
.. versionchanged:: 2017.5 .. versionchanged:: 2017.5.0
Runner uses the pillar_enc variable that allows renderers to render the pillar. Runner uses the pillar_enc variable that allows renderers to render the pillar.
This is usable when supplying the contents of a file as pillar, and the file contains This is usable when supplying the contents of a file as pillar, and the file contains

View file

@ -2,7 +2,7 @@
ACME / Let's Encrypt certificate management state ACME / Let's Encrypt certificate management state
================================================= =================================================
.. versionadded:: 2016.3 .. versionadded:: 2016.3.0
See also the module documentation See also the module documentation

View file

@ -36,7 +36,7 @@ the above word between angle brackets (<>).
- FollowSymlinks - FollowSymlinks
AllowOverride: All AllowOverride: All
.. versionchanged:: 2018.3 .. versionchanged:: 2018.3.0
Allows having the same section container multiple times (e.g. <Directory /path/to/dir>). Allows having the same section container multiple times (e.g. <Directory /path/to/dir>).

View file

@ -1987,7 +1987,7 @@ def tidied(
**kwargs **kwargs
): ):
""" """
.. versionchanged:: 3006.0,3005 .. versionchanged:: 3005,3006.0
Remove unwanted files based on specific criteria. Remove unwanted files based on specific criteria.

View file

@ -274,7 +274,7 @@ def lv_present(
force force
Assume yes to all prompts Assume yes to all prompts
.. versionadded:: 3002.0 .. versionadded:: 3002
resizefs resizefs
Use fsadm to resize the logical volume filesystem if needed Use fsadm to resize the logical volume filesystem if needed

View file

@ -22,11 +22,11 @@ def present(name, parent=None, vlan=None):
parent : string parent : string
name of the parent bridge (if the bridge shall be created as a fake name of the parent bridge (if the bridge shall be created as a fake
bridge). If specified, vlan must also be specified. bridge). If specified, vlan must also be specified.
.. versionadded:: 3006 .. versionadded:: 3006.0
vlan: int vlan: int
VLAN ID of the bridge (if the bridge shall be created as a fake VLAN ID of the bridge (if the bridge shall be created as a fake
bridge). If specified, parent must also be specified. bridge). If specified, parent must also be specified.
.. versionadded:: 3006 .. versionadded:: 3006.0
""" """
ret = {"name": name, "changes": {}, "result": False, "comment": ""} ret = {"name": name, "changes": {}, "result": False, "comment": ""}

View file

@ -1,7 +1,7 @@
""" """
Management of Open vSwitch database records. Management of Open vSwitch database records.
.. versionadded:: 3006 .. versionadded:: 3006.0
""" """

View file

@ -5,7 +5,7 @@ Management of Pacemaker/Corosync clusters with PCS
A state module to manage Pacemaker/Corosync clusters A state module to manage Pacemaker/Corosync clusters
with the Pacemaker/Corosync configuration system (PCS) with the Pacemaker/Corosync configuration system (PCS)
.. versionadded:: 2016.110 .. versionadded:: 2016.11.0
:depends: pcs :depends: pcs

View file

@ -1,7 +1,7 @@
""" """
Management of Zabbix Action object over Zabbix API. Management of Zabbix Action object over Zabbix API.
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
:codeauthor: Jakub Sliva <jakub.sliva@ultimum.io> :codeauthor: Jakub Sliva <jakub.sliva@ultimum.io>
""" """

View file

@ -1,5 +1,5 @@
""" """
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
Management of Zabbix Template object over Zabbix API. Management of Zabbix Template object over Zabbix API.

View file

@ -1,7 +1,7 @@
""" """
Management of Zabbix Valuemap object over Zabbix API. Management of Zabbix Valuemap object over Zabbix API.
.. versionadded:: 2017.7 .. versionadded:: 2017.7.0
:codeauthor: Jakub Sliva <jakub.sliva@ultimum.io> :codeauthor: Jakub Sliva <jakub.sliva@ultimum.io>
""" """