From 2830a3452d4eccb86eb78ac653dbc326c8a90a40 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 25 Oct 2022 08:07:21 +0200 Subject: [PATCH] Remove deprecated features, bump version to 6.0.0 (#5326) * Bump version to 6.0.0. * sender option is now required. * Default of want_proxmox_nodes_ansible_host changed from true to false. * username is now an alias of user, and no longer of workspace. * Remove deprecated return values in favor of end_state. * Remove debug option. * Change default of ignore_volatile_options from true to false. * gitlab_group must now always contain the full path. * Change default of norc from false to ture. * Remove deprecated property. * Add PR URL. * Adjust bitbucket unit tests. * Adjust module_helper integration test. --- changelogs/fragments/deprecation-removals.yml | 11 ++++ galaxy.yml | 2 +- plugins/callback/mail.py | 7 +-- plugins/doc_fragments/bitbucket.py | 2 + plugins/inventory/proxmox.py | 13 +---- plugins/module_utils/mh/module_helper.py | 14 +---- .../module_utils/source_control/bitbucket.py | 2 +- plugins/modules/cloud/lxd/lxd_container.py | 15 +---- plugins/modules/cloud/smartos/vmadm.py | 3 +- .../keycloak/keycloak_authentication.py | 36 ------------ .../identity/keycloak/keycloak_group.py | 58 ------------------- plugins/modules/packaging/language/gem.py | 13 +---- .../bitbucket/bitbucket_access_key.py | 6 +- .../bitbucket/bitbucket_pipeline_key_pair.py | 8 +-- .../bitbucket_pipeline_known_host.py | 8 +-- .../bitbucket/bitbucket_pipeline_variable.py | 8 +-- .../gitlab/gitlab_group_members.py | 8 +-- .../targets/module_helper/library/mstate.py | 7 --- .../targets/module_helper/tasks/mstate.yml | 19 ------ tests/sanity/ignore-2.11.txt | 1 - tests/sanity/ignore-2.12.txt | 1 - tests/sanity/ignore-2.13.txt | 1 - tests/sanity/ignore-2.14.txt | 1 - tests/sanity/ignore-2.15.txt | 1 - .../bitbucket/test_bitbucket_access_key.py | 16 ++--- .../test_bitbucket_pipeline_key_pair.py | 16 ++--- .../test_bitbucket_pipeline_known_host.py | 12 ++-- .../test_bitbucket_pipeline_variable.py | 24 ++++---- 28 files changed, 70 insertions(+), 243 deletions(-) create mode 100644 changelogs/fragments/deprecation-removals.yml diff --git a/changelogs/fragments/deprecation-removals.yml b/changelogs/fragments/deprecation-removals.yml new file mode 100644 index 0000000000..a7744bbc40 --- /dev/null +++ b/changelogs/fragments/deprecation-removals.yml @@ -0,0 +1,11 @@ +removed_features: + - "mail callback plugin - the ``sender`` option is now required (https://github.com/ansible-collections/community.general/pull/5326)." + - "proxmox inventory plugin - the default of the ``want_proxmox_nodes_ansible_host`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326)." + - "bitbucket* modules - ``username`` is no longer an alias of ``workspace``, but of ``user`` (https://github.com/ansible-collections/community.general/pull/5326)." + - "keycloak_group - the return value ``group`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326)." + - "keycloak_authentication - the return value ``flow`` has been removed. Use ``end_state`` instead (https://github.com/ansible-collections/community.general/pull/5326)." + - "vmadm - the ``debug`` option has been removed. It was not used anyway (https://github.com/ansible-collections/community.general/pull/5326)." + - "lxd_container - the default of the ``ignore_volatile_options`` option changed from ``true`` to ``false`` (https://github.com/ansible-collections/community.general/pull/5326)." + - "gitlab_group_members - ``gitlab_group`` must now always contain the full path, and no longer just the name or path (https://github.com/ansible-collections/community.general/pull/5326)." + - "gem - the default of the ``norc`` option changed from ``false`` to ``true`` (https://github.com/ansible-collections/community.general/pull/5326)." + - "module_helper module utils - remove the ``VarDict`` attribute from ``ModuleHelper``. Import ``VarDict`` from ``ansible_collections.community.general.plugins.module_utils.mh.mixins.vars`` instead (https://github.com/ansible-collections/community.general/pull/5326)." diff --git a/galaxy.yml b/galaxy.yml index 6742288ccd..0a3fe09b6e 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -5,7 +5,7 @@ namespace: community name: general -version: 5.8.0 +version: 6.0.0 readme: README.md authors: - Ansible (https://github.com/ansible) diff --git a/plugins/callback/mail.py b/plugins/callback/mail.py index d20600e710..a605d13eac 100644 --- a/plugins/callback/mail.py +++ b/plugins/callback/mail.py @@ -49,8 +49,9 @@ options: sender: description: - Mail sender. - - Note that this will be required from community.general 6.0.0 on. + - This is required since community.general 6.0.0. type: str + required: true ini: - section: callback_mail key: sender @@ -105,10 +106,6 @@ class CallbackModule(CallbackBase): super(CallbackModule, self).set_options(task_keys=task_keys, var_options=var_options, direct=direct) self.sender = self.get_option('sender') - if self.sender is None: - self._display.deprecated( - 'The sender for the mail callback has not been specified. This will be an error in the future', - version='6.0.0', collection_name='community.general') self.to = self.get_option('to') self.smtphost = self.get_option('mta') self.smtpport = self.get_option('mtaport') diff --git a/plugins/doc_fragments/bitbucket.py b/plugins/doc_fragments/bitbucket.py index 9ab6fe318d..703bb412a1 100644 --- a/plugins/doc_fragments/bitbucket.py +++ b/plugins/doc_fragments/bitbucket.py @@ -27,8 +27,10 @@ options: description: - The username. - If not set the environment variable C(BITBUCKET_USERNAME) will be used. + - I(username) is an alias of I(user) since community.genreal 6.0.0. It was an alias of I(workspace) before. type: str version_added: 4.0.0 + aliases: [ username ] password: description: - The App password. diff --git a/plugins/inventory/proxmox.py b/plugins/inventory/proxmox.py index e4474e6e6e..67e0428157 100644 --- a/plugins/inventory/proxmox.py +++ b/plugins/inventory/proxmox.py @@ -113,10 +113,9 @@ DOCUMENTATION = ''' description: - Whether to set C(ansbile_host) for proxmox nodes. - When set to C(true) (default), will use the first available interface. This can be different from what you expect. - - This currently defaults to C(true), but the default is deprecated since community.general 4.8.0. - The default will change to C(false) in community.general 6.0.0. To avoid a deprecation warning, please - set this parameter explicitly. + - The default of this option changed from C(true) to C(false) in community.general 6.0.0. type: bool + default: false filters: version_added: 4.6.0 description: A list of Jinja templates that allow filtering hosts. @@ -567,14 +566,6 @@ class InventoryModule(BaseInventoryPlugin, Constructable, Cacheable): self.inventory.add_group(nodes_group) want_proxmox_nodes_ansible_host = self.get_option("want_proxmox_nodes_ansible_host") - if want_proxmox_nodes_ansible_host is None: - display.deprecated( - 'The want_proxmox_nodes_ansible_host option of the community.general.proxmox inventory plugin' - ' currently defaults to `true`, but this default has been deprecated and will change to `false`' - ' in community.general 6.0.0. To keep the current behavior and remove this deprecation warning,' - ' explicitly set `want_proxmox_nodes_ansible_host` to `true` in your inventory configuration', - version='6.0.0', collection_name='community.general') - want_proxmox_nodes_ansible_host = True # gather vm's on nodes self._get_auth() diff --git a/plugins/module_utils/mh/module_helper.py b/plugins/module_utils/mh/module_helper.py index 79b6f48752..c844acba50 100644 --- a/plugins/module_utils/mh/module_helper.py +++ b/plugins/module_utils/mh/module_helper.py @@ -13,7 +13,7 @@ from ansible_collections.community.general.plugins.module_utils.mh.base import M from ansible_collections.community.general.plugins.module_utils.mh.mixins.cmd import CmdMixin from ansible_collections.community.general.plugins.module_utils.mh.mixins.state import StateMixin from ansible_collections.community.general.plugins.module_utils.mh.mixins.deps import DependencyMixin -from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarsMixin, VarDict as _VD +from ansible_collections.community.general.plugins.module_utils.mh.mixins.vars import VarsMixin from ansible_collections.community.general.plugins.module_utils.mh.mixins.deprecate_attrs import DeprecateAttrsMixin @@ -25,8 +25,6 @@ class ModuleHelper(DeprecateAttrsMixin, VarsMixin, DependencyMixin, ModuleHelper change_params = () facts_params = () - VarDict = _VD # for backward compatibility, will be deprecated at some point - def __init__(self, module=None): super(ModuleHelper, self).__init__(module) for name, value in self.module.params.items(): @@ -38,16 +36,6 @@ class ModuleHelper(DeprecateAttrsMixin, VarsMixin, DependencyMixin, ModuleHelper fact=name in self.facts_params, ) - self._deprecate_attr( - attr="VarDict", - msg="ModuleHelper.VarDict attribute is deprecated, use VarDict from " - "the ansible_collections.community.general.plugins.module_utils.mh.mixins.vars module instead", - version="6.0.0", - collection_name="community.general", - target=ModuleHelper, - module=self.module, - ) - def update_output(self, **kwargs): self.update_vars(meta={"output": True}, **kwargs) diff --git a/plugins/module_utils/source_control/bitbucket.py b/plugins/module_utils/source_control/bitbucket.py index 592905a65f..9a27361830 100644 --- a/plugins/module_utils/source_control/bitbucket.py +++ b/plugins/module_utils/source_control/bitbucket.py @@ -28,7 +28,7 @@ class BitbucketHelper: # TODO: # - Rename user to username once current usage of username is removed # - Alias user to username and deprecate it - user=dict(type='str', fallback=(env_fallback, ['BITBUCKET_USERNAME'])), + user=dict(type='str', aliases=['username'], fallback=(env_fallback, ['BITBUCKET_USERNAME'])), password=dict(type='str', no_log=True, fallback=(env_fallback, ['BITBUCKET_PASSWORD'])), ) diff --git a/plugins/modules/cloud/lxd/lxd_container.py b/plugins/modules/cloud/lxd/lxd_container.py index c96271bda4..30dc855617 100644 --- a/plugins/modules/cloud/lxd/lxd_container.py +++ b/plugins/modules/cloud/lxd/lxd_container.py @@ -50,10 +50,10 @@ options: - If set to C(true), options starting with C(volatile.) are ignored. As a result, they are reapplied for each execution. - This default behavior can be changed by setting this option to C(false). - - The current default value C(true) is deprecated since community.general 4.0.0, - and will change to C(false) in community.general 6.0.0. + - The default value changed from C(true) to C(false) in community.general 6.0.0. type: bool required: false + default: false version_added: 3.7.0 profiles: description: @@ -769,6 +769,7 @@ def main(): ), ignore_volatile_options=dict( type='bool', + default=False, ), devices=dict( type='dict', @@ -832,16 +833,6 @@ def main(): supports_check_mode=False, ) - if module.params['ignore_volatile_options'] is None: - module.params['ignore_volatile_options'] = True - module.deprecate( - 'If the keyword "volatile" is used in a playbook in the config' - 'section, a "changed" message will appear with every run, even without a change' - 'to the playbook.' - 'This will change in the future. Please test your scripts' - 'by "ignore_volatile_options: false". To keep the old behavior, set that option explicitly to "true"', - version='6.0.0', collection_name='community.general') - lxd_manage = LXDContainerManagement(module=module) lxd_manage.run() diff --git a/plugins/modules/cloud/smartos/vmadm.py b/plugins/modules/cloud/smartos/vmadm.py index c352de90f7..3bc016d679 100644 --- a/plugins/modules/cloud/smartos/vmadm.py +++ b/plugins/modules/cloud/smartos/vmadm.py @@ -552,7 +552,7 @@ def create_payload(module, uuid): # Create the JSON payload (vmdef) and return the filename. # Filter out the few options that are not valid VM properties. - module_options = ['debug', 'force', 'state'] + module_options = ['force', 'state'] # @TODO make this a simple {} comprehension as soon as py2 is ditched # @TODO {k: v for k, v in p.items() if k not in module_options} vmdef = dict([(k, v) for k, v in module.params.items() if k not in module_options and v]) @@ -689,7 +689,6 @@ def main(): nics=dict(type='list', elements='dict'), resolvers=dict(type='list', elements='str'), filesystems=dict(type='list', elements='dict'), - debug=dict(type='bool', removed_in_version='6.0.0', removed_from_collection='community.general'), ) # Add our 'simple' options to options dict. diff --git a/plugins/modules/identity/keycloak/keycloak_authentication.py b/plugins/modules/identity/keycloak/keycloak_authentication.py index e2e680814f..4f56582951 100644 --- a/plugins/modules/identity/keycloak/keycloak_authentication.py +++ b/plugins/modules/identity/keycloak/keycloak_authentication.py @@ -173,39 +173,6 @@ msg: returned: always type: str -flow: - description: - - JSON representation for the authentication. - - Deprecated return value, it will be removed in community.general 6.0.0. Please use the return value I(end_state) instead. - returned: on success - type: dict - sample: { - "alias": "Copy of first broker login", - "authenticationExecutions": [ - { - "alias": "review profile config", - "authenticationConfig": { - "alias": "review profile config", - "config": { "update.profile.on.first.login": "missing" }, - "id": "6f09e4fb-aad4-496a-b873-7fa9779df6d7" - }, - "configurable": true, - "displayName": "Review Profile", - "id": "8f77dab8-2008-416f-989e-88b09ccf0b4c", - "index": 0, - "level": 0, - "providerId": "idp-review-profile", - "requirement": "REQUIRED", - "requirementChoices": [ "REQUIRED", "ALTERNATIVE", "DISABLED" ] - } - ], - "builtIn": false, - "description": "Actions taken after first broker login with identity provider account, which is not yet linked to any Keycloak account", - "id": "bc228863-5887-4297-b898-4d988f8eaa5c", - "providerId": "basic-flow", - "topLevel": true - } - end_state: description: Representation of the authentication after module execution. returned: on success @@ -407,7 +374,6 @@ def main(): result['diff'] = dict(before='', after='') result['changed'] = False result['end_state'] = {} - result['flow'] = result['end_state'] result['msg'] = new_auth_repr["alias"] + ' absent' module.exit_json(**result) @@ -440,7 +406,6 @@ def main(): if exec_repr is not None: auth_repr["authenticationExecutions"] = exec_repr result['end_state'] = auth_repr - result['flow'] = result['end_state'] else: if state == 'present': @@ -478,7 +443,6 @@ def main(): if exec_repr is not None: auth_repr["authenticationExecutions"] = exec_repr result['end_state'] = auth_repr - result['flow'] = result['end_state'] else: # Process a deletion (because state was not 'present') diff --git a/plugins/modules/identity/keycloak/keycloak_group.py b/plugins/modules/identity/keycloak/keycloak_group.py index 1ae3859ef2..3df87c8fe5 100644 --- a/plugins/modules/identity/keycloak/keycloak_group.py +++ b/plugins/modules/identity/keycloak/keycloak_group.py @@ -214,59 +214,6 @@ end_state: manage: true manageMembership: true view: true - -group: - description: - - Representation of the group after module execution. - - Deprecated return value, it will be removed in community.general 6.0.0. Please use the return value I(end_state) instead. - returned: always - type: complex - contains: - id: - description: GUID that identifies the group. - type: str - returned: always - sample: 23f38145-3195-462c-97e7-97041ccea73e - name: - description: Name of the group. - type: str - returned: always - sample: grp-test-123 - attributes: - description: Attributes applied to this group. - type: dict - returned: always - sample: - attr1: ["val1", "val2", "val3"] - path: - description: URI path to the group. - type: str - returned: always - sample: /grp-test-123 - realmRoles: - description: An array of the realm-level roles granted to this group. - type: list - returned: always - sample: [] - subGroups: - description: A list of groups that are children of this group. These groups will have the same parameters as - documented here. - type: list - returned: always - clientRoles: - description: A list of client-level roles granted to this group. - type: list - returned: always - sample: [] - access: - description: A dict describing the accesses you have to this group based on the credentials used. - type: dict - returned: always - sample: - manage: true - manageMembership: true - view: true - ''' from ansible_collections.community.general.plugins.module_utils.identity.keycloak.keycloak import KeycloakAPI, camel, \ @@ -356,7 +303,6 @@ def main(): result['diff'] = dict(before='', after='') result['changed'] = False result['end_state'] = {} - result['group'] = result['end_state'] result['msg'] = 'Group does not exist; doing nothing.' module.exit_json(**result) @@ -377,7 +323,6 @@ def main(): after_group = kc.get_group_by_name(name, realm) result['end_state'] = after_group - result['group'] = result['end_state'] result['msg'] = 'Group {name} has been created with ID {id}'.format(name=after_group['name'], id=after_group['id']) @@ -391,7 +336,6 @@ def main(): if desired_group == before_group: result['changed'] = False result['end_state'] = desired_group - result['group'] = result['end_state'] result['msg'] = "No changes required to group {name}.".format(name=before_group['name']) module.exit_json(**result) @@ -410,7 +354,6 @@ def main(): after_group = kc.get_group_by_groupid(desired_group['id'], realm=realm) result['end_state'] = after_group - result['group'] = result['end_state'] result['msg'] = "Group {id} has been updated".format(id=after_group['id']) module.exit_json(**result) @@ -430,7 +373,6 @@ def main(): kc.delete_group(groupid=gid, realm=realm) result['end_state'] = {} - result['group'] = result['end_state'] result['msg'] = "Group {name} has been deleted".format(name=before_group['name']) diff --git a/plugins/modules/packaging/language/gem.py b/plugins/modules/packaging/language/gem.py index e30bf458d4..8d7f7dade0 100644 --- a/plugins/modules/packaging/language/gem.py +++ b/plugins/modules/packaging/language/gem.py @@ -70,11 +70,10 @@ options: version_added: 3.3.0 norc: type: bool + default: true description: - Avoid loading any C(.gemrc) file. Ignored for RubyGems prior to 2.5.2. - - The current default value C(false) has been deprecated in community.general 5.0.0. - Explicitly specify the value to prevent the deprecation warning to be shown." - - From community.general 6.0.0 on, the default will be changed to C(true). + - The default changed from C(false) to C(true) in community.general 6.0.0. version_added: 3.3.0 env_shebang: description: @@ -298,7 +297,7 @@ def main(): user_install=dict(required=False, default=True, type='bool'), install_dir=dict(required=False, type='path'), bindir=dict(type='path'), - norc=dict(type='bool'), + norc=dict(type='bool', default=True), pre_release=dict(required=False, default=False, type='bool'), include_doc=dict(required=False, default=False, type='bool'), env_shebang=dict(required=False, default=False, type='bool'), @@ -316,12 +315,6 @@ def main(): module.fail_json(msg="Cannot maintain state=latest when installing from local source") if module.params['user_install'] and module.params['install_dir']: module.fail_json(msg="install_dir requires user_install=false") - if module.params['norc'] is None: - module.deprecate( - 'The default of the norc option has been deprecated. It will be changed to `true`' - ' in community.general 6.0.0. Specify an explicit value to get rid of this message', - version='6.0.0', collection_name='community.general') - module.params['norc'] = False if not module.params['gem_source']: module.params['gem_source'] = module.params['name'] diff --git a/plugins/modules/source_control/bitbucket/bitbucket_access_key.py b/plugins/modules/source_control/bitbucket/bitbucket_access_key.py index f084b98027..0708777a0a 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_access_key.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_access_key.py @@ -27,10 +27,9 @@ options: workspace: description: - The repository owner. - - Alias I(username) has been deprecated and will become an alias of I(user) in community.general 6.0.0. + - I(username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of I(user). type: str required: true - aliases: [ username ] key: description: - The SSH public key. @@ -218,8 +217,7 @@ def main(): argument_spec.update( repository=dict(type='str', required=True), workspace=dict( - type='str', aliases=['username'], required=True, - deprecated_aliases=[dict(name='username', version='6.0.0', collection_name='community.general')], + type='str', required=True, ), key=dict(type='str', no_log=False), label=dict(type='str', required=True), diff --git a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py index 97e1ee3bbb..db4453d45c 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_key_pair.py @@ -27,10 +27,9 @@ options: workspace: description: - The repository owner. - - Alias I(username) has been deprecated and will become an alias of I(user) in community.general 6.0.0. + - I(username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of I(user). type: str required: true - aliases: [ username ] public_key: description: - The public key. @@ -154,10 +153,7 @@ def main(): argument_spec = BitbucketHelper.bitbucket_argument_spec() argument_spec.update( repository=dict(type='str', required=True), - workspace=dict( - type='str', aliases=['username'], required=True, - deprecated_aliases=[dict(name='username', version='6.0.0', collection_name='community.general')], - ), + workspace=dict(type='str', required=True), public_key=dict(type='str'), private_key=dict(type='str', no_log=True), state=dict(type='str', choices=['present', 'absent'], required=True), diff --git a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py index b8ceb8f90f..e573719362 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_known_host.py @@ -30,10 +30,9 @@ options: workspace: description: - The repository owner. - - Alias I(username) has been deprecated and will become an alias of I(user) in community.general 6.0.0. + - I(username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of I(user). type: str required: true - aliases: [ username ] name: description: - The FQDN of the known host. @@ -255,10 +254,7 @@ def main(): argument_spec = BitbucketHelper.bitbucket_argument_spec() argument_spec.update( repository=dict(type='str', required=True), - workspace=dict( - type='str', aliases=['username'], required=True, - deprecated_aliases=[dict(name='username', version='6.0.0', collection_name='community.general')], - ), + workspace=dict(type='str', required=True), name=dict(type='str', required=True), key=dict(type='str', no_log=False), state=dict(type='str', choices=['present', 'absent'], required=True), diff --git a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py index daf65d0b4d..45661d8dee 100644 --- a/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py +++ b/plugins/modules/source_control/bitbucket/bitbucket_pipeline_variable.py @@ -27,10 +27,9 @@ options: workspace: description: - The repository owner. - - Alias I(username) has been deprecated and will become an alias of I(user) in community.general 6.0.0. + - I(username) used to be an alias of this option. Since community.general 6.0.0 it is an alias of I(user). type: str required: true - aliases: [ username ] name: description: - The pipeline variable name. @@ -215,10 +214,7 @@ def main(): argument_spec = BitbucketHelper.bitbucket_argument_spec() argument_spec.update( repository=dict(type='str', required=True), - workspace=dict( - type='str', aliases=['username'], required=True, - deprecated_aliases=[dict(name='username', version='6.0.0', collection_name='community.general')], - ), + workspace=dict(type='str', required=True), name=dict(type='str', required=True), value=dict(type='str'), secured=dict(type='bool', default=False), diff --git a/plugins/modules/source_control/gitlab/gitlab_group_members.py b/plugins/modules/source_control/gitlab/gitlab_group_members.py index 50cb35367f..6edc8c983f 100644 --- a/plugins/modules/source_control/gitlab/gitlab_group_members.py +++ b/plugins/modules/source_control/gitlab/gitlab_group_members.py @@ -27,7 +27,7 @@ options: gitlab_group: description: - The C(full_path) of the GitLab group the member is added to/removed from. - - Setting this to C(name) or C(path) is deprecated and will be removed in community.general 6.0.0. Use C(full_path) instead. + - Setting this to C(name) or C(path) has been disallowed since community.general 6.0.0. Use C(full_path) instead. required: true type: str gitlab_user: @@ -176,12 +176,6 @@ class GitLabGroup(object): for group in groups: if group.full_path == gitlab_group: return group.id - for group in groups: - if group.path == gitlab_group or group.name == gitlab_group: - self._module.deprecate( - msg="Setting 'gitlab_group' to 'name' or 'path' is deprecated. Use 'full_path' instead", - version="6.0.0", collection_name="community.general") - return group.id # get all members in a group def get_members_in_a_group(self, gitlab_group_id): diff --git a/tests/integration/targets/module_helper/library/mstate.py b/tests/integration/targets/module_helper/library/mstate.py index 6c69f9c720..9e70ed4364 100644 --- a/tests/integration/targets/module_helper/library/mstate.py +++ b/tests/integration/targets/module_helper/library/mstate.py @@ -25,10 +25,6 @@ options: c: description: cccc type: str - trigger_depr_attr: - description: tries to access VarDict - type: bool - default: false state: description: test states type: str @@ -50,15 +46,12 @@ class MState(StateModuleHelper): a=dict(type='int', required=True), b=dict(type='str'), c=dict(type='str'), - trigger_depr_attr=dict(type='bool', default=False), state=dict(type='str', choices=['join', 'b_x_a', 'c_x_a', 'both_x_a', 'nop'], default='join'), ), ) def __init_module__(self): self.vars.set('result', "abc", diff=True) - if self.vars.trigger_depr_attr: - dummy = self.VarDict def state_join(self): self.vars['result'] = "".join([str(self.vars.a), str(self.vars.b), str(self.vars.c)]) diff --git a/tests/integration/targets/module_helper/tasks/mstate.yml b/tests/integration/targets/module_helper/tasks/mstate.yml index 7a4e9ad3e4..40c695f6dc 100644 --- a/tests/integration/targets/module_helper/tasks/mstate.yml +++ b/tests/integration/targets/module_helper/tasks/mstate.yml @@ -70,25 +70,9 @@ a: 5 b: foo c: bar - trigger_depr_attr: true state: both_x_a register: state5 -- ansible.builtin.set_fact: - vardict_gt29: - msg: >- - ModuleHelper.VarDict attribute is deprecated, use VarDict from the - ansible_collections.community.general.plugins.module_utils.mh.mixins.vars - module instead - version: 6.0.0 - collection_name: community.general - vardict_29: - msg: >- - ModuleHelper.VarDict attribute is deprecated, use VarDict from the - ansible_collections.community.general.plugins.module_utils.mh.mixins.vars - module instead - version: 6.0.0 - - name: assert state5 assert: that: @@ -97,6 +81,3 @@ - state5.c == "bar" - state5.result == "foobarfoobarfoobarfoobarfoobar" - state5 is changed - - vardict_depr in state5.deprecations - vars: - vardict_depr: '{{ (ansible_version.major == 2 and ansible_version.minor == 9) | ternary(vardict_29, vardict_gt29) }}' diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 924e4f863b..86db6d3a2c 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -12,7 +12,6 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 65cd74872a..77cfe75bbd 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -7,7 +7,6 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 65cd74872a..77cfe75bbd 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -7,7 +7,6 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 4e5d3334b0..6ca8d9d972 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -7,7 +7,6 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index 4e5d3334b0..6ca8d9d972 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -7,7 +7,6 @@ plugins/modules/cloud/rackspace/rax_files.py validate-modules:parameter-state-in plugins/modules/cloud/rackspace/rax_files_objects.py use-argspec-type-path plugins/modules/cloud/rackspace/rax_scaling_group.py use-argspec-type-path # fix needed, expanduser() applied to dict values plugins/modules/cloud/scaleway/scaleway_organization_info.py validate-modules:return-syntax-error -plugins/modules/cloud/smartos/vmadm.py validate-modules:parameter-type-not-in-doc # unused param - removed in 6.0.0 plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-list-no-elements plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:parameter-type-not-in-doc plugins/modules/cloud/spotinst/spotinst_aws_elastigroup.py validate-modules:undocumented-parameter diff --git a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py index 4c53cd8246..be926b55df 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_access_key.py @@ -22,7 +22,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'label': 'key name', 'state': 'present', @@ -57,7 +57,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'key': 'public_key', 'label': 'key name', @@ -108,7 +108,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'key': 'new public key', 'label': 'mykey', @@ -159,7 +159,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'key': 'new public key', 'label': 'mykey', @@ -210,7 +210,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'key': 'new public key', 'label': 'mykey', @@ -261,7 +261,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'label': 'mykey', 'state': 'absent', @@ -279,7 +279,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'label': 'mykey', 'state': 'absent', @@ -327,7 +327,7 @@ class TestBucketAccessKeyModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'label': 'mykey', 'state': 'absent', diff --git a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py index 8b370a10ed..050790a426 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_key_pair.py @@ -22,7 +22,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'state': 'present', }) @@ -56,7 +56,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'public_key': 'public', 'private_key': 'PRIVATE', @@ -79,7 +79,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'public_key': 'public', 'private_key': 'PRIVATE', @@ -101,7 +101,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'public_key': 'public', 'private_key': 'PRIVATE', @@ -123,7 +123,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'public_key': 'public', 'private_key': 'PRIVATE', @@ -146,7 +146,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'state': 'absent', }) @@ -163,7 +163,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'state': 'absent', }) @@ -183,7 +183,7 @@ class TestBucketPipelineKeyPairModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'state': 'absent', '_ansible_check_mode': True, diff --git a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py index faf8ca009a..163cecdf4d 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_known_host.py @@ -29,7 +29,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'present', @@ -78,7 +78,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'present', @@ -97,7 +97,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'present', @@ -128,7 +128,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'absent', @@ -147,7 +147,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'absent', @@ -177,7 +177,7 @@ class TestBucketPipelineKnownHostModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'bitbucket.org', 'state': 'absent', diff --git a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py index ad9ec58044..99d3af4f92 100644 --- a/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py +++ b/tests/unit/plugins/modules/source_control/bitbucket/test_bitbucket_pipeline_variable.py @@ -20,7 +20,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): def test_without_required_parameters(self): with self.assertRaises(AnsibleFailJson) as exec_info: set_module_args({ - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'absent', @@ -34,7 +34,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'present', @@ -52,7 +52,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): def test_oauth_env_vars_params(self, *args): with self.assertRaises(AnsibleExitJson): set_module_args({ - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'absent', @@ -100,7 +100,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -126,7 +126,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -150,7 +150,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -176,7 +176,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -202,7 +202,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -227,7 +227,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'value': '42', @@ -253,7 +253,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'absent', @@ -271,7 +271,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'absent', @@ -295,7 +295,7 @@ class TestBucketPipelineVariableModule(ModuleTestCase): set_module_args({ 'client_id': 'ABC', 'client_secret': 'XXX', - 'username': 'name', + 'workspace': 'name', 'repository': 'repo', 'name': 'PIPELINE_VAR_NAME', 'state': 'absent',