diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 23240c88e00..3e2d91b9e37 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1046,7 +1046,7 @@ repos: - repo: https://github.com/s0undt3ch/salt-rewrite # Automatically rewrite code with known rules - rev: 2.0.0 + rev: 2.4.2 hooks: - id: salt-rewrite alias: rewrite-docstrings @@ -1058,10 +1058,6 @@ repos: salt/ext/.* )$ - - repo: https://github.com/s0undt3ch/salt-rewrite - # Automatically rewrite code with known rules - rev: 2.0.0 - hooks: - id: salt-rewrite alias: rewrite-tests name: Rewrite Salt's Test Suite diff --git a/salt/_logging/handlers.py b/salt/_logging/handlers.py index f4b0b6fec3d..7492b55b8fd 100644 --- a/salt/_logging/handlers.py +++ b/salt/_logging/handlers.py @@ -88,7 +88,7 @@ class DeferredStreamHandler(StreamHandler): If anything goes wrong before logging is properly setup, all stored messages 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): diff --git a/salt/cache/consul.py b/salt/cache/consul.py index 14c08cc4d25..547e2fe4e2d 100644 --- a/salt/cache/consul.py +++ b/salt/cache/consul.py @@ -3,7 +3,7 @@ Minion data cache plugin for Consul key/value data store. .. versionadded:: 2016.11.2 -.. versionchanged:: 3005.0 +.. versionchanged:: 3005 Timestamp/cache updated support added. diff --git a/salt/client/ssh/wrapper/pillar.py b/salt/client/ssh/wrapper/pillar.py index 98fcb66a9ff..bc1b625d5cb 100644 --- a/salt/client/ssh/wrapper/pillar.py +++ b/salt/client/ssh/wrapper/pillar.py @@ -17,7 +17,7 @@ except ImportError: 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 available return the passed default. The default return is an empty string. diff --git a/salt/cloud/clouds/clc.py b/salt/cloud/clouds/clc.py index f2912531acc..c111c49a481 100644 --- a/salt/cloud/clouds/clc.py +++ b/salt/cloud/clouds/clc.py @@ -2,7 +2,7 @@ CenturyLink Cloud Module ======================== -.. versionadded:: 2018.3 +.. versionadded:: 2018.3.0 The CLC cloud module allows you to manage CLC Via the CLC SDK. diff --git a/salt/grains/metadata_gce.py b/salt/grains/metadata_gce.py index c641843a30d..0c98a03b6ae 100644 --- a/salt/grains/metadata_gce.py +++ b/salt/grains/metadata_gce.py @@ -2,7 +2,7 @@ Grains from cloud metadata servers at 169.254.169.254 in google compute engine -.. versionadded:: 3005.0 +.. versionadded:: 3005 :depends: requests diff --git a/salt/modules/acme.py b/salt/modules/acme.py index 3a15662eddc..7952acc1aad 100644 --- a/salt/modules/acme.py +++ b/salt/modules/acme.py @@ -2,7 +2,7 @@ ACME / Let's Encrypt module =========================== -.. versionadded:: 2016.3 +.. versionadded:: 2016.3.0 This module currently looks for certbot script in the $PATH as - certbot, diff --git a/salt/modules/aptpkg.py b/salt/modules/aptpkg.py index 2ec69c58898..cbf9c7706c5 100644 --- a/salt/modules/aptpkg.py +++ b/salt/modules/aptpkg.py @@ -3506,7 +3506,7 @@ def _get_http_proxy_url(): def list_downloaded(root=None, **kwargs): """ - .. versionadded:: 3000? + .. versionadded:: 3000 List prefetched packages downloaded by apt in the local disk. diff --git a/salt/modules/git.py b/salt/modules/git.py index 71b771b6f1b..62dd7028994 100644 --- a/salt/modules/git.py +++ b/salt/modules/git.py @@ -1019,7 +1019,7 @@ def clone( https_user Set HTTP Basic Auth username. Only accepted for HTTPS URLs. - .. versionadded:: 20515.5.0 + .. versionadded:: 2015.5.0 https_pass Set HTTP Basic Auth password. Only accepted for HTTPS URLs. diff --git a/salt/modules/mod_random.py b/salt/modules/mod_random.py index 247056a63d0..5a2b0ef868d 100644 --- a/salt/modules/mod_random.py +++ b/salt/modules/mod_random.py @@ -89,7 +89,7 @@ def get_str( ): """ .. 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. @@ -99,14 +99,14 @@ def get_str( Any valid number of bytes. chars : None - .. versionadded:: 3004.0 + .. versionadded:: 3004 String with any character that should be used to generate random string. This argument supersedes all other character controlling arguments. lowercase : True - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use lowercase letters in generated random string. (see :py:data:`string.ascii_lowercase`) @@ -114,7 +114,7 @@ def get_str( This argument is superseded by chars. uppercase : True - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use uppercase letters in generated random string. (see :py:data:`string.ascii_uppercase`) @@ -122,7 +122,7 @@ def get_str( This argument is superseded by chars. digits : True - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use digits in generated random string. (see :py:data:`string.digits`) @@ -130,7 +130,7 @@ def get_str( This argument is superseded by chars. printable : False - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use printable characters in generated random string and includes lowercase, uppercase, digits, punctuation and whitespace. @@ -143,7 +143,7 @@ def get_str( This argument is superseded by chars. punctuation : True - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use punctuation characters in generated random string. (see :py:data:`string.punctuation`) @@ -151,7 +151,7 @@ def get_str( This argument is superseded by chars. whitespace : False - .. versionadded:: 3004.0 + .. versionadded:: 3004 Use whitespace characters in generated random string. (see :py:data:`string.whitespace`) diff --git a/salt/modules/openvswitch.py b/salt/modules/openvswitch.py index eb34cb82eb0..e0dc7ac2677 100644 --- a/salt/modules/openvswitch.py +++ b/salt/modules/openvswitch.py @@ -193,11 +193,11 @@ def bridge_create(br, may_exist=True, parent=None, vlan=None): parent : string name of the parent bridge (if the bridge shall be created as a fake bridge). If specified, vlan must also be specified. - .. versionadded:: 3006 + .. versionadded:: 3006.0 vlan : int VLAN ID of the bridge (if the bridge shall be created as a fake bridge). If specified, parent must also be specified. - .. versionadded:: 3006 + .. versionadded:: 3006.0 Returns: True on success, else False. @@ -252,7 +252,7 @@ def bridge_delete(br, if_exists=True): def bridge_to_parent(br): """ - .. versionadded:: 3006 + .. versionadded:: 3006.0 Returns the parent bridge of a bridge. @@ -280,7 +280,7 @@ def bridge_to_parent(br): def bridge_to_vlan(br): """ - .. versionadded:: 3006 + .. versionadded:: 3006.0 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): """ - .. versionadded:: 3006 + .. versionadded:: 3006.0 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): """ - .. versionadded:: 3006 + .. versionadded:: 3006.0 Sets a column's value for a specific record. diff --git a/salt/modules/pillar.py b/salt/modules/pillar.py index b96c8ec6b70..ba195ab3e39 100644 --- a/salt/modules/pillar.py +++ b/salt/modules/pillar.py @@ -32,7 +32,7 @@ def get( saltenv=None, ): """ - .. versionadded:: 0.14 + .. versionadded:: 0.14.0 Attempt to retrieve the named value from :ref:`in-memory pillar data `. If the pillar key is not present in the in-memory diff --git a/salt/modules/rh_service.py b/salt/modules/rh_service.py index 4a697101ef0..b8b802479fe 100644 --- a/salt/modules/rh_service.py +++ b/salt/modules/rh_service.py @@ -545,7 +545,7 @@ def delete(name, **kwargs): """ Delete the named service - .. versionadded:: 2016.3 + .. versionadded:: 2016.3.0 CLI Example: diff --git a/salt/modules/sysmod.py b/salt/modules/sysmod.py index 190435e21e0..e756e544139 100644 --- a/salt/modules/sysmod.py +++ b/salt/modules/sysmod.py @@ -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.s*' - .. versionadded:: 2016.9 + .. versionadded:: 2016.9.0 .. code-block:: bash diff --git a/salt/modules/win_system.py b/salt/modules/win_system.py index b203ae36a06..0801d40aa93 100644 --- a/salt/modules/win_system.py +++ b/salt/modules/win_system.py @@ -755,7 +755,7 @@ def join_domain( ``True`` will restart the computer after a successful join. Default is ``False`` - .. versionadded:: 2015.8.2/2015.5.7 + .. versionadded:: 2015.5.7,2015.8.2 Returns: dict: Returns a dictionary if successful, otherwise ``False`` @@ -889,7 +889,7 @@ def unjoin_domain( workgroup (str): 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): ``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 is ``False`` - .. versionadded:: 2015.8.2/2015.5.7 + .. versionadded:: 2015.5.7,2015.8.2 Returns: dict: Returns a dictionary if successful, otherwise ``False`` diff --git a/salt/modules/yumpkg.py b/salt/modules/yumpkg.py index 4d0070f21a8..7190525937b 100644 --- a/salt/modules/yumpkg.py +++ b/salt/modules/yumpkg.py @@ -1905,7 +1905,7 @@ def upgrade( Disable exclude from main, for a repo or for everything. (e.g., ``yum --disableexcludes='main'``) - .. versionadded:: 2014.7 + .. versionadded:: 2014.7.0 name 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): 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``. List information on locked packages @@ -2573,7 +2573,7 @@ def group_list(): def group_info(name, expand=False, ignore_groups=None): """ .. 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 distinguish environment groups from package groups. Also, keys for the 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): """ .. 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, similar to the changes made in :py:func:`pkg.group_info `. diff --git a/salt/modules/zabbix.py b/salt/modules/zabbix.py index d6fdeacc929..f09ca1df3ba 100644 --- a/salt/modules/zabbix.py +++ b/salt/modules/zabbix.py @@ -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. - .. versionchanged:: 2017.7 + .. versionchanged:: 2017.7.0 """ unauthenticated_methods = [ @@ -311,7 +311,7 @@ def _map_to_list_of_dicts(source, key): def get_zabbix_id_mapper(): """ - .. versionadded:: 2017.7 + .. versionadded:: 2017.7.0 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): """ - .. 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 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 def compare_params(defined, existing, return_old_value=False): """ - .. versionadded:: 2017.7 + .. versionadded:: 2017.7.0 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): """ - .. versionadded:: 2017.7 + .. versionadded:: 2017.7.0 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): """ - .. versionadded:: 2017.7 + .. versionadded:: 2017.7.0 Imports Zabbix configuration specified in file to Zabbix server. diff --git a/salt/pillar/netbox.py b/salt/pillar/netbox.py index 808c58c9d89..bbbf765e62a 100644 --- a/salt/pillar/netbox.py +++ b/salt/pillar/netbox.py @@ -56,28 +56,28 @@ site_prefixes: ``True`` Whether should retrieve the prefixes of the site the device belongs to. devices: ``True`` - .. versionadded:: 3004.0 + .. versionadded:: 3004 Whether should retrieve physical devices. virtual_machines: ``False`` - .. versionadded:: 3004.0 + .. versionadded:: 3004 Whether should retrieve virtual machines. interfaces: ``False`` - .. versionadded:: 3004.0 + .. versionadded:: 3004 Whether should retrieve the interfaces of the device. interface_ips: ``False`` - .. versionadded:: 3004.0 + .. versionadded:: 3004 Whether should retrieve the IP addresses for interfaces of the device. (interfaces must be set to True as well) api_query_result_limit: ``Use NetBox default`` - .. versionadded:: 3004.0 + .. versionadded:: 3004 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. diff --git a/salt/runners/state.py b/salt/runners/state.py index 44017c3792c..3baf1b86346 100644 --- a/salt/runners/state.py +++ b/salt/runners/state.py @@ -86,7 +86,7 @@ def orchestrate( 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. This is usable when supplying the contents of a file as pillar, and the file contains diff --git a/salt/states/acme.py b/salt/states/acme.py index 82423c309b0..6cd9e165f6c 100644 --- a/salt/states/acme.py +++ b/salt/states/acme.py @@ -2,7 +2,7 @@ ACME / Let's Encrypt certificate management state ================================================= -.. versionadded:: 2016.3 +.. versionadded:: 2016.3.0 See also the module documentation diff --git a/salt/states/apache.py b/salt/states/apache.py index 058097a49e0..8b340b7de48 100644 --- a/salt/states/apache.py +++ b/salt/states/apache.py @@ -36,7 +36,7 @@ the above word between angle brackets (<>). - FollowSymlinks AllowOverride: All -.. versionchanged:: 2018.3 +.. versionchanged:: 2018.3.0 Allows having the same section container multiple times (e.g. ). diff --git a/salt/states/file.py b/salt/states/file.py index f481537d529..b40f5ef84c0 100644 --- a/salt/states/file.py +++ b/salt/states/file.py @@ -1987,7 +1987,7 @@ def tidied( **kwargs ): """ - .. versionchanged:: 3006.0,3005 + .. versionchanged:: 3005,3006.0 Remove unwanted files based on specific criteria. diff --git a/salt/states/lvm.py b/salt/states/lvm.py index 72470a9b07f..b48bf6dde3a 100644 --- a/salt/states/lvm.py +++ b/salt/states/lvm.py @@ -274,7 +274,7 @@ def lv_present( force Assume yes to all prompts - .. versionadded:: 3002.0 + .. versionadded:: 3002 resizefs Use fsadm to resize the logical volume filesystem if needed diff --git a/salt/states/openvswitch_bridge.py b/salt/states/openvswitch_bridge.py index 4ee3b3ef880..13c4109598d 100644 --- a/salt/states/openvswitch_bridge.py +++ b/salt/states/openvswitch_bridge.py @@ -22,11 +22,11 @@ def present(name, parent=None, vlan=None): parent : string name of the parent bridge (if the bridge shall be created as a fake bridge). If specified, vlan must also be specified. - .. versionadded:: 3006 + .. versionadded:: 3006.0 vlan: int VLAN ID of the bridge (if the bridge shall be created as a fake bridge). If specified, parent must also be specified. - .. versionadded:: 3006 + .. versionadded:: 3006.0 """ ret = {"name": name, "changes": {}, "result": False, "comment": ""} diff --git a/salt/states/openvswitch_db.py b/salt/states/openvswitch_db.py index c874ca2b53f..22ee5f8822e 100644 --- a/salt/states/openvswitch_db.py +++ b/salt/states/openvswitch_db.py @@ -1,7 +1,7 @@ """ Management of Open vSwitch database records. -.. versionadded:: 3006 +.. versionadded:: 3006.0 """ diff --git a/salt/states/pcs.py b/salt/states/pcs.py index 6cc1e3eabf6..cd124c1a82a 100644 --- a/salt/states/pcs.py +++ b/salt/states/pcs.py @@ -5,7 +5,7 @@ Management of Pacemaker/Corosync clusters with PCS A state module to manage Pacemaker/Corosync clusters with the Pacemaker/Corosync configuration system (PCS) -.. versionadded:: 2016.110 +.. versionadded:: 2016.11.0 :depends: pcs diff --git a/salt/states/zabbix_action.py b/salt/states/zabbix_action.py index ba5e2992731..01877edcacd 100644 --- a/salt/states/zabbix_action.py +++ b/salt/states/zabbix_action.py @@ -1,7 +1,7 @@ """ Management of Zabbix Action object over Zabbix API. -.. versionadded:: 2017.7 +.. versionadded:: 2017.7.0 :codeauthor: Jakub Sliva """ diff --git a/salt/states/zabbix_template.py b/salt/states/zabbix_template.py index 70e87ea2e4f..53efe618cac 100644 --- a/salt/states/zabbix_template.py +++ b/salt/states/zabbix_template.py @@ -1,5 +1,5 @@ """ -.. versionadded:: 2017.7 +.. versionadded:: 2017.7.0 Management of Zabbix Template object over Zabbix API. diff --git a/salt/states/zabbix_valuemap.py b/salt/states/zabbix_valuemap.py index 006e4a7b35c..23c14e16869 100644 --- a/salt/states/zabbix_valuemap.py +++ b/salt/states/zabbix_valuemap.py @@ -1,7 +1,7 @@ """ Management of Zabbix Valuemap object over Zabbix API. -.. versionadded:: 2017.7 +.. versionadded:: 2017.7.0 :codeauthor: Jakub Sliva """