diff --git a/changelogs/fragments/363-deprecations.yml b/changelogs/fragments/363-deprecations.yml new file mode 100644 index 00000000..aa6ff1aa --- /dev/null +++ b/changelogs/fragments/363-deprecations.yml @@ -0,0 +1,3 @@ +removed_features: + - "docker_stack - the return values ``out`` and ``err`` have been removed. Use ``stdout`` and ``stderr`` instead (https://github.com/ansible-collections/community.docker/pull/363)." + - "Various modules - the default of ``tls_hostname`` (``localhost``) has been removed. If you want to continue using ``localhost``, you need to specify it explicitly (https://github.com/ansible-collections/community.docker/pull/363)." diff --git a/plugins/doc_fragments/docker.py b/plugins/doc_fragments/docker.py index 162b3a33..ba614577 100644 --- a/plugins/doc_fragments/docker.py +++ b/plugins/doc_fragments/docker.py @@ -27,9 +27,7 @@ options: - When verifying the authenticity of the Docker Host server, provide the expected name of the server. - If the value is not specified in the task, the value of environment variable C(DOCKER_TLS_HOSTNAME) will be used instead. If the environment variable is not set, the default value will be used. - - The current default value is C(localhost). This default is deprecated and will change in community.docker - 2.0.0 to be a value computed from I(docker_host). Explicitly specify C(localhost) to make sure this value - will still be used, and to disable the deprecation message which will be shown otherwise. + - Note that this option had a default value C(localhost) in older versions. It was removed in community.docker 3.0.0. type: str api_version: description: diff --git a/plugins/module_utils/common.py b/plugins/module_utils/common.py index dd0f6984..a022e262 100644 --- a/plugins/module_utils/common.py +++ b/plugins/module_utils/common.py @@ -323,10 +323,7 @@ class AnsibleDockerClientBase(Client): use_ssh_client=self._get_value('use_ssh_client', params['use_ssh_client'], None, False), ) - def depr(*args, **kwargs): - self.deprecate(*args, **kwargs) - - update_tls_hostname(result, old_behavior=True, deprecate_function=depr, uses_tls=is_using_tls(result)) + update_tls_hostname(result) return result diff --git a/plugins/module_utils/util.py b/plugins/module_utils/util.py index 44424d0c..b09017da 100644 --- a/plugins/module_utils/util.py +++ b/plugins/module_utils/util.py @@ -107,22 +107,9 @@ class DockerBaseClass(object): def update_tls_hostname(result, old_behavior=False, deprecate_function=None, uses_tls=True): if result['tls_hostname'] is None: - if old_behavior: - result['tls_hostname'] = DEFAULT_TLS_HOSTNAME - if uses_tls and deprecate_function is not None: - deprecate_function( - 'The default value "localhost" for tls_hostname is deprecated and will be removed in community.docker 3.0.0.' - ' From then on, docker_host will be used to compute tls_hostname. If you want to keep using "localhost",' - ' please set that value explicitly.', - version='3.0.0', collection_name='community.docker') - return - # get default machine name from the url parsed_url = urlparse(result['docker_host']) - if ':' in parsed_url.netloc: - result['tls_hostname'] = parsed_url.netloc[:parsed_url.netloc.rindex(':')] - else: - result['tls_hostname'] = parsed_url + result['tls_hostname'] = parsed_url.netloc.rsplit(':', 1)[0] def compare_dict_allow_more_present(av, bv): diff --git a/plugins/modules/docker_stack.py b/plugins/modules/docker_stack.py index 7a900dd7..e020a33c 100644 --- a/plugins/modules/docker_stack.py +++ b/plugins/modules/docker_stack.py @@ -76,9 +76,6 @@ options: requirements: - jsondiff - pyyaml - -notes: - - Return values I(out) and I(err) have been deprecated and will be removed in community.docker 3.0.0. Use I(stdout) and I(stderr) instead. ''' RETURN = ''' @@ -260,7 +257,6 @@ def main(): if rc != 0: module.fail_json(msg="docker stack up deploy command failed", rc=rc, - out=out, err=err, # Deprecated stdout=out, stderr=err) before_after_differences = json_diff(before_stack_services, @@ -294,12 +290,10 @@ def main(): if rc != 0: module.fail_json(msg="'docker stack down' command failed", rc=rc, - out=out, err=err, # Deprecated stdout=out, stderr=err) else: module.exit_json(changed=True, msg=out, rc=rc, - err=err, # Deprecated stdout=out, stderr=err) module.exit_json(changed=False)