summaryrefslogtreecommitdiff
path: root/test/support
diff options
context:
space:
mode:
authorFelix Fontein <felix@fontein.de>2020-05-29 07:46:16 +0200
committerGitHub <noreply@github.com>2020-05-28 22:46:16 -0700
commit40f21dfd3c7699f5e333fed257da5f452b78f4b4 (patch)
treeb7fd475176bc9e9ae1bc75af2bf1150e3fc60a00 /test/support
parentf5f3ba7ab5d5e3b0d462ed985f8b9d614f28583f (diff)
downloadansible-40f21dfd3c7699f5e333fed257da5f452b78f4b4.tar.gz
Version source tagging (automatic and manual) for version_added and deprecation versions (#69680)
* Track collection for version_added. Validate *all* version numbers in validate-modules. For tagged version numbers (i.e. version_added), consider source collection to chose validation. * Make tagging/untagging functions more flexible. * Tag all versions in doc fragments. * Tag all deprecation versions issued by code. * Make Display.deprecated() understand tagged versions. * Extend validation to enforce tagged version numbers. * Tag versions in tests. * Lint and fix test. * Mention collection name in collection loader's deprecation/removal messages. * Fix error IDs. * Handle tagged dates in Display.deprecated(). * Also require that removed_at_date and deprecated_aliases.date are tagged. * Also automatically tag/untag removed_at_date; fix sanity module removal version check. * Improve error message when invalid version number is used (like '2.14' in collections).
Diffstat (limited to 'test/support')
-rw-r--r--test/support/integration/plugins/modules/aws_az_info.py2
-rw-r--r--test/support/integration/plugins/modules/azure_rm_functionapp_info.py2
-rw-r--r--test/support/integration/plugins/modules/azure_rm_mariadbconfiguration_info.py3
-rw-r--r--test/support/integration/plugins/modules/azure_rm_mariadbdatabase_info.py3
-rw-r--r--test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py3
-rw-r--r--test/support/integration/plugins/modules/azure_rm_mariadbserver_info.py2
-rw-r--r--test/support/integration/plugins/modules/azure_rm_resource_info.py2
-rw-r--r--test/support/integration/plugins/modules/azure_rm_webapp_info.py2
-rw-r--r--test/support/integration/plugins/modules/cloudformation_info.py2
-rw-r--r--test/support/integration/plugins/modules/docker_swarm.py2
-rw-r--r--test/support/integration/plugins/modules/ec2.py2
-rw-r--r--test/support/integration/plugins/modules/ec2_ami_info.py2
-rw-r--r--test/support/integration/plugins/modules/ec2_eni_info.py2
-rw-r--r--test/support/integration/plugins/modules/ec2_instance_info.py2
-rw-r--r--test/support/integration/plugins/modules/iam_role.py2
-rw-r--r--test/support/integration/plugins/modules/k8s_info.py2
-rw-r--r--test/support/integration/plugins/modules/openssl_certificate.py4
-rw-r--r--test/support/integration/plugins/modules/openssl_certificate_info.py2
-rw-r--r--test/support/integration/plugins/modules/openssl_csr.py4
-rw-r--r--test/support/integration/plugins/modules/openssl_privatekey.py2
-rw-r--r--test/support/integration/plugins/modules/python_requirements_info.py2
-rw-r--r--test/support/integration/plugins/modules/xml.py3
22 files changed, 28 insertions, 24 deletions
diff --git a/test/support/integration/plugins/modules/aws_az_info.py b/test/support/integration/plugins/modules/aws_az_info.py
index eccbf4d7d4..0685a0b574 100644
--- a/test/support/integration/plugins/modules/aws_az_info.py
+++ b/test/support/integration/plugins/modules/aws_az_info.py
@@ -86,7 +86,7 @@ def main():
module = AnsibleAWSModule(argument_spec=argument_spec)
if module._name == 'aws_az_facts':
- module.deprecate("The 'aws_az_facts' module has been renamed to 'aws_az_info'", version='2.14')
+ module.deprecate("The 'aws_az_facts' module has been renamed to 'aws_az_info'", version='ansible.builtin:2.14')
connection = module.client('ec2', retry_decorator=AWSRetry.jittered_backoff())
diff --git a/test/support/integration/plugins/modules/azure_rm_functionapp_info.py b/test/support/integration/plugins/modules/azure_rm_functionapp_info.py
index 0cd5b6f60b..19652577dd 100644
--- a/test/support/integration/plugins/modules/azure_rm_functionapp_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_functionapp_info.py
@@ -136,7 +136,7 @@ class AzureRMFunctionAppInfo(AzureRMModuleBase):
is_old_facts = self.module._name == 'azure_rm_functionapp_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_functionapp_facts' module has been renamed to 'azure_rm_functionapp_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_functionapp_facts' module has been renamed to 'azure_rm_functionapp_info'", version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_mariadbconfiguration_info.py b/test/support/integration/plugins/modules/azure_rm_mariadbconfiguration_info.py
index ad38f1255f..df1b41da13 100644
--- a/test/support/integration/plugins/modules/azure_rm_mariadbconfiguration_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_mariadbconfiguration_info.py
@@ -139,7 +139,8 @@ class AzureRMMariaDbConfigurationInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_mariadbconfiguration_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_mariadbconfiguration_facts' module has been renamed to 'azure_rm_mariadbconfiguration_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_mariadbconfiguration_facts' module has been renamed to 'azure_rm_mariadbconfiguration_info'",
+ version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_mariadbdatabase_info.py b/test/support/integration/plugins/modules/azure_rm_mariadbdatabase_info.py
index 61e33015b1..dbbb2da970 100644
--- a/test/support/integration/plugins/modules/azure_rm_mariadbdatabase_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_mariadbdatabase_info.py
@@ -145,7 +145,8 @@ class AzureRMMariaDbDatabaseInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_mariadbdatabase_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_mariadbdatabase_facts' module has been renamed to 'azure_rm_mariadbdatabase_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_mariadbdatabase_facts' module has been renamed to 'azure_rm_mariadbdatabase_info'",
+ version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py b/test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py
index 45557b5113..c6857bea48 100644
--- a/test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_mariadbfirewallrule_info.py
@@ -141,7 +141,8 @@ class AzureRMMariaDbFirewallRuleInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_mariadbfirewallrule_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_mariadbfirewallrule_facts' module has been renamed to 'azure_rm_mariadbfirewallrule_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_mariadbfirewallrule_facts' module has been renamed to 'azure_rm_mariadbfirewallrule_info'",
+ version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_mariadbserver_info.py b/test/support/integration/plugins/modules/azure_rm_mariadbserver_info.py
index ffe52c5d37..5e8e1a82da 100644
--- a/test/support/integration/plugins/modules/azure_rm_mariadbserver_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_mariadbserver_info.py
@@ -193,7 +193,7 @@ class AzureRMMariaDbServerInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_mariadbserver_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_mariadbserver_facts' module has been renamed to 'azure_rm_mariadbserver_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_mariadbserver_facts' module has been renamed to 'azure_rm_mariadbserver_info'", version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_resource_info.py b/test/support/integration/plugins/modules/azure_rm_resource_info.py
index 354cd79578..5d553a0d42 100644
--- a/test/support/integration/plugins/modules/azure_rm_resource_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_resource_info.py
@@ -336,7 +336,7 @@ class AzureRMResourceInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_resource_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_resource_facts' module has been renamed to 'azure_rm_resource_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_resource_facts' module has been renamed to 'azure_rm_resource_info'", version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/azure_rm_webapp_info.py b/test/support/integration/plugins/modules/azure_rm_webapp_info.py
index 4a3b4cd484..e722ffdf16 100644
--- a/test/support/integration/plugins/modules/azure_rm_webapp_info.py
+++ b/test/support/integration/plugins/modules/azure_rm_webapp_info.py
@@ -265,7 +265,7 @@ class AzureRMWebAppInfo(AzureRMModuleBase):
def exec_module(self, **kwargs):
is_old_facts = self.module._name == 'azure_rm_webapp_facts'
if is_old_facts:
- self.module.deprecate("The 'azure_rm_webapp_facts' module has been renamed to 'azure_rm_webapp_info'", version='2.13')
+ self.module.deprecate("The 'azure_rm_webapp_facts' module has been renamed to 'azure_rm_webapp_info'", version='ansible.builtin:2.13')
for key in self.module_arg_spec:
setattr(self, key, kwargs[key])
diff --git a/test/support/integration/plugins/modules/cloudformation_info.py b/test/support/integration/plugins/modules/cloudformation_info.py
index f62b80235d..d10429326d 100644
--- a/test/support/integration/plugins/modules/cloudformation_info.py
+++ b/test/support/integration/plugins/modules/cloudformation_info.py
@@ -302,7 +302,7 @@ def main():
is_old_facts = module._name == 'cloudformation_facts'
if is_old_facts:
module.deprecate("The 'cloudformation_facts' module has been renamed to 'cloudformation_info', "
- "and the renamed one no longer returns ansible_facts", version='2.13')
+ "and the renamed one no longer returns ansible_facts", version='ansible.builtin:2.13')
service_mgr = CloudFormationServiceManager(module)
diff --git a/test/support/integration/plugins/modules/docker_swarm.py b/test/support/integration/plugins/modules/docker_swarm.py
index 4fd4c875c4..e802e20245 100644
--- a/test/support/integration/plugins/modules/docker_swarm.py
+++ b/test/support/integration/plugins/modules/docker_swarm.py
@@ -450,7 +450,7 @@ class SwarmManager(DockerBaseClass):
if self.state == 'inspect':
self.client.module.deprecate(
"The 'inspect' state is deprecated, please use 'docker_swarm_info' to inspect swarm cluster",
- version='2.12')
+ version='ansible.builtin:2.12')
choice_map.get(self.state)()
diff --git a/test/support/integration/plugins/modules/ec2.py b/test/support/integration/plugins/modules/ec2.py
index 91503bbf8e..b01c5a66d5 100644
--- a/test/support/integration/plugins/modules/ec2.py
+++ b/test/support/integration/plugins/modules/ec2.py
@@ -1695,7 +1695,7 @@ def main():
module.deprecate(
msg='Support for passing both group and group_id has been deprecated. '
'Currently group_id is ignored, in future passing both will result in an error',
- version='2.14')
+ version='ansible.builtin:2.14')
if not HAS_BOTO:
module.fail_json(msg='boto required for this module')
diff --git a/test/support/integration/plugins/modules/ec2_ami_info.py b/test/support/integration/plugins/modules/ec2_ami_info.py
index 41e1aa83f9..e7cbe0532c 100644
--- a/test/support/integration/plugins/modules/ec2_ami_info.py
+++ b/test/support/integration/plugins/modules/ec2_ami_info.py
@@ -270,7 +270,7 @@ def main():
module = AnsibleAWSModule(argument_spec=argument_spec, supports_check_mode=True)
if module._module._name == 'ec2_ami_facts':
- module._module.deprecate("The 'ec2_ami_facts' module has been renamed to 'ec2_ami_info'", version='2.13')
+ module._module.deprecate("The 'ec2_ami_facts' module has been renamed to 'ec2_ami_info'", version='ansible.builtin:2.13')
ec2_client = module.client('ec2')
diff --git a/test/support/integration/plugins/modules/ec2_eni_info.py b/test/support/integration/plugins/modules/ec2_eni_info.py
index 99922a84d1..31efbfdd38 100644
--- a/test/support/integration/plugins/modules/ec2_eni_info.py
+++ b/test/support/integration/plugins/modules/ec2_eni_info.py
@@ -259,7 +259,7 @@ def main():
module = AnsibleModule(argument_spec=argument_spec)
if module._name == 'ec2_eni_facts':
- module.deprecate("The 'ec2_eni_facts' module has been renamed to 'ec2_eni_info'", version='2.13')
+ module.deprecate("The 'ec2_eni_facts' module has been renamed to 'ec2_eni_info'", version='ansible.builtin:2.13')
if not HAS_BOTO3:
module.fail_json(msg='boto3 required for this module')
diff --git a/test/support/integration/plugins/modules/ec2_instance_info.py b/test/support/integration/plugins/modules/ec2_instance_info.py
index 7615b958d3..cd8e0cd7d5 100644
--- a/test/support/integration/plugins/modules/ec2_instance_info.py
+++ b/test/support/integration/plugins/modules/ec2_instance_info.py
@@ -552,7 +552,7 @@ def main():
supports_check_mode=True
)
if module._name == 'ec2_instance_facts':
- module.deprecate("The 'ec2_instance_facts' module has been renamed to 'ec2_instance_info'", version='2.13')
+ module.deprecate("The 'ec2_instance_facts' module has been renamed to 'ec2_instance_info'", version='ansible.builtin:2.13')
if not HAS_BOTO3:
module.fail_json(msg='boto3 required for this module')
diff --git a/test/support/integration/plugins/modules/iam_role.py b/test/support/integration/plugins/modules/iam_role.py
index 71a5b0377e..1027232be0 100644
--- a/test/support/integration/plugins/modules/iam_role.py
+++ b/test/support/integration/plugins/modules/iam_role.py
@@ -637,7 +637,7 @@ def main():
if module.params.get('purge_policies') is None:
module.deprecate('In Ansible 2.14 the default value of purge_policies will change from true to false.'
- ' To maintain the existing behaviour explicity set purge_policies=true', version='2.14')
+ ' To maintain the existing behaviour explicity set purge_policies=true', version='ansible.builtin:2.14')
if module.params.get('boundary'):
if module.params.get('create_instance_profile'):
diff --git a/test/support/integration/plugins/modules/k8s_info.py b/test/support/integration/plugins/modules/k8s_info.py
index 99a8fd8cec..37e8066895 100644
--- a/test/support/integration/plugins/modules/k8s_info.py
+++ b/test/support/integration/plugins/modules/k8s_info.py
@@ -142,7 +142,7 @@ class KubernetesInfoModule(KubernetesAnsibleModule):
supports_check_mode=True,
**kwargs)
if self._name == 'k8s_facts':
- self.deprecate("The 'k8s_facts' module has been renamed to 'k8s_info'", version='2.13')
+ self.deprecate("The 'k8s_facts' module has been renamed to 'k8s_info'", version='ansible.builtin:2.13')
def execute_module(self):
self.client = self.get_api_client()
diff --git a/test/support/integration/plugins/modules/openssl_certificate.py b/test/support/integration/plugins/modules/openssl_certificate.py
index 4bd5e5c468..d8af142e1b 100644
--- a/test/support/integration/plugins/modules/openssl_certificate.py
+++ b/test/support/integration/plugins/modules/openssl_certificate.py
@@ -2654,7 +2654,7 @@ def main():
if provider == 'assertonly':
module.deprecate("The 'assertonly' provider is deprecated; please see the examples of "
"the 'openssl_certificate' module on how to replace it with other modules",
- version='2.13')
+ version='ansible.builtin:2.13')
elif provider == 'selfsigned':
if module.params['privatekey_path'] is None and module.params['privatekey_content'] is None:
module.fail_json(msg='One of privatekey_path and privatekey_content must be specified for the selfsigned provider.')
@@ -2702,7 +2702,7 @@ def main():
except AttributeError:
module.fail_json(msg='You need to have PyOpenSSL>=0.15')
- module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='2.13')
+ module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='ansible.builtin:2.13')
if provider == 'selfsigned':
certificate = SelfSignedCertificate(module)
elif provider == 'acme':
diff --git a/test/support/integration/plugins/modules/openssl_certificate_info.py b/test/support/integration/plugins/modules/openssl_certificate_info.py
index 2d7459ae9d..2b947a8777 100644
--- a/test/support/integration/plugins/modules/openssl_certificate_info.py
+++ b/test/support/integration/plugins/modules/openssl_certificate_info.py
@@ -845,7 +845,7 @@ def main():
except AttributeError:
module.fail_json(msg='You need to have PyOpenSSL>=0.15')
- module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='2.13')
+ module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='ansible.builtin:2.13')
certificate = CertificateInfoPyOpenSSL(module)
elif backend == 'cryptography':
if not CRYPTOGRAPHY_FOUND:
diff --git a/test/support/integration/plugins/modules/openssl_csr.py b/test/support/integration/plugins/modules/openssl_csr.py
index ea2cf68c2a..b184cabe9d 100644
--- a/test/support/integration/plugins/modules/openssl_csr.py
+++ b/test/support/integration/plugins/modules/openssl_csr.py
@@ -1091,7 +1091,7 @@ def main():
if module.params['version'] != 1:
module.deprecate('The version option will only support allowed values from Ansible 2.14 on. '
- 'Currently, only the value 1 is allowed by RFC 2986', version='2.14')
+ 'Currently, only the value 1 is allowed by RFC 2986', version='ansible.builtin:2.14')
base_dir = os.path.dirname(module.params['path']) or '.'
if not os.path.isdir(base_dir):
@@ -1125,7 +1125,7 @@ def main():
except AttributeError:
module.fail_json(msg='You need to have PyOpenSSL>=0.15 to generate CSRs')
- module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='2.13')
+ module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='ansible.builtin:2.13')
csr = CertificateSigningRequestPyOpenSSL(module)
elif backend == 'cryptography':
if not CRYPTOGRAPHY_FOUND:
diff --git a/test/support/integration/plugins/modules/openssl_privatekey.py b/test/support/integration/plugins/modules/openssl_privatekey.py
index 2fdfdab10c..d0ce6ae7b0 100644
--- a/test/support/integration/plugins/modules/openssl_privatekey.py
+++ b/test/support/integration/plugins/modules/openssl_privatekey.py
@@ -908,7 +908,7 @@ def main():
if not PYOPENSSL_FOUND:
module.fail_json(msg=missing_required_lib('pyOpenSSL >= {0}'.format(MINIMAL_PYOPENSSL_VERSION)),
exception=PYOPENSSL_IMP_ERR)
- module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='2.13')
+ module.deprecate('The module is using the PyOpenSSL backend. This backend has been deprecated', version='ansible.builtin:2.13')
private_key = PrivateKeyPyOpenSSL(module)
elif backend == 'cryptography':
if not CRYPTOGRAPHY_FOUND:
diff --git a/test/support/integration/plugins/modules/python_requirements_info.py b/test/support/integration/plugins/modules/python_requirements_info.py
index aa9e70ec86..e89f5db26e 100644
--- a/test/support/integration/plugins/modules/python_requirements_info.py
+++ b/test/support/integration/plugins/modules/python_requirements_info.py
@@ -118,7 +118,7 @@ def main():
supports_check_mode=True,
)
if module._name == 'python_requirements_facts':
- module.deprecate("The 'python_requirements_facts' module has been renamed to 'python_requirements_info'", version='2.13')
+ module.deprecate("The 'python_requirements_facts' module has been renamed to 'python_requirements_info'", version='ansible.builtin:2.13')
if not HAS_DISTUTILS:
module.fail_json(
msg='Could not import "distutils" and "pkg_resources" libraries to introspect python environment.',
diff --git a/test/support/integration/plugins/modules/xml.py b/test/support/integration/plugins/modules/xml.py
index c71b3c1778..281e9f5558 100644
--- a/test/support/integration/plugins/modules/xml.py
+++ b/test/support/integration/plugins/modules/xml.py
@@ -885,7 +885,8 @@ def main():
# Report wrongly used attribute parameter when using content=attribute
# TODO: Remove this in Ansible v2.12 (and reinstate strict parameter test above) and remove the integration test example
if content == 'attribute' and attribute is not None:
- module.deprecate("Parameter 'attribute=%s' is ignored when using 'content=attribute' only 'xpath' is used. Please remove entry." % attribute, '2.12')
+ module.deprecate("Parameter 'attribute=%s' is ignored when using 'content=attribute' only 'xpath' is used. Please remove entry." % attribute,
+ 'ansible.builtin:2.12')
# Check if the file exists
if xml_string: