summaryrefslogtreecommitdiffstats
path: root/lib/ansible/galaxy/api.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/ansible/galaxy/api.py')
-rw-r--r--lib/ansible/galaxy/api.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/ansible/galaxy/api.py b/lib/ansible/galaxy/api.py
index af7f162..156dd4c 100644
--- a/lib/ansible/galaxy/api.py
+++ b/lib/ansible/galaxy/api.py
@@ -2,8 +2,7 @@
# Copyright: (c) 2019, Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
-from __future__ import (absolute_import, division, print_function)
-__metaclass__ = type
+from __future__ import annotations
import collections
import datetime
@@ -134,6 +133,15 @@ def g_connect(versions):
% (method.__name__, ", ".join(versions), ", ".join(available_versions),
self.name, self.api_server))
+ # Warn only when we know we are talking to a collections API
+ if common_versions == {'v2'}:
+ display.deprecated(
+ 'The v2 Ansible Galaxy API is deprecated and no longer supported. '
+ 'Ensure that you have configured the ansible-galaxy CLI to utilize an '
+ 'updated and supported version of Ansible Galaxy.',
+ version='2.20'
+ )
+
return method(self, *args, **kwargs)
return wrapped
return decorator