From 1ce79db7633ce2a8caf71681222466a95e18de18 Mon Sep 17 00:00:00 2001 From: Reto Kupferschmid Date: Sun, 29 Aug 2021 13:20:46 +0200 Subject: [PATCH] add deprecation warning for python-dnsimple 1 (#3267) * add deprecation warning for python-dnsimple 1 * add changelog fragment * Update changelogs/fragments/3267-dnsimple1-deprecation.yml Co-authored-by: Felix Fontein * Update plugins/modules/net_tools/dnsimple.py Co-authored-by: Felix Fontein * fix typo Co-authored-by: Felix Fontein * Update plugins/modules/net_tools/dnsimple.py Co-authored-by: Felix Fontein * Update changelogs/fragments/3267-dnsimple1-deprecation.yml Co-authored-by: Felix Fontein Co-authored-by: Felix Fontein --- changelogs/fragments/3267-dnsimple1-deprecation.yml | 3 +++ plugins/modules/net_tools/dnsimple.py | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/3267-dnsimple1-deprecation.yml diff --git a/changelogs/fragments/3267-dnsimple1-deprecation.yml b/changelogs/fragments/3267-dnsimple1-deprecation.yml new file mode 100644 index 0000000000..dadc1d2901 --- /dev/null +++ b/changelogs/fragments/3267-dnsimple1-deprecation.yml @@ -0,0 +1,3 @@ +--- +deprecated_features: + - "dnsimple - python-dnsimple < 2.0.0 is deprecated and support for it will be removed in community.general 5.0.0 (https://github.com/ansible-collections/community.general/pull/2946#discussion_r667624693)." diff --git a/plugins/modules/net_tools/dnsimple.py b/plugins/modules/net_tools/dnsimple.py index 188f9fd64a..3681348f4e 100644 --- a/plugins/modules/net_tools/dnsimple.py +++ b/plugins/modules/net_tools/dnsimple.py @@ -82,6 +82,8 @@ options: version_added: 3.5.0 requirements: - "dnsimple >= 1.0.0" +notes: + - "Support for C(dnsimple < 2) is deprecated and will be removed in community.general 5.0.0." author: "Alex Coomans (@drcapulet)" ''' @@ -402,6 +404,11 @@ def main(): if DNSIMPLE_MAJOR_VERSION > 1: ds = DNSimpleV2(account_email, account_api_token, sandbox, module) else: + module.deprecate( + 'Support for python-dnsimple < 2 is deprecated. ' + 'Update python-dnsimple to version >= 2.0.0', + version='5.0.0', collection_name='community.general' + ) ds = DNSimpleV1(account_email, account_api_token, sandbox, module) # Let's figure out what operation we want to do # No domain, return a list