From c56dc6215d1cef8a7a49d012013fb817a38be830 Mon Sep 17 00:00:00 2001 From: Rene Moser Date: Mon, 23 Jan 2023 09:01:12 +0100 Subject: [PATCH] deprecate in favor of vultr.cloud --- galaxy.yml | 2 +- plugins/doc_fragments/vultr.py | 5 ++++- plugins/module_utils/vultr.py | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 1a2360c..162ba8b 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -16,4 +16,4 @@ tags: - cloud - vultr - ngine_io -version: 1.1.2 +version: 1.2.0 diff --git a/plugins/doc_fragments/vultr.py b/plugins/doc_fragments/vultr.py index cb5cfb6..6386e35 100644 --- a/plugins/doc_fragments/vultr.py +++ b/plugins/doc_fragments/vultr.py @@ -3,6 +3,7 @@ # Copyright (c) 2017 René Moser # 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 @@ -54,5 +55,7 @@ class ModuleDocFragment(object): requirements: - python >= 2.6 notes: - - Also see the API documentation on https://www.vultr.com/api/. + - "DEPRECATED: Please use vultr.cloud instead." + - Also see the API documentation on https://www.vultr.com/api/v1/. + ''' diff --git a/plugins/module_utils/vultr.py b/plugins/module_utils/vultr.py index 81e7b62..74b3908 100644 --- a/plugins/module_utils/vultr.py +++ b/plugins/module_utils/vultr.py @@ -3,17 +3,18 @@ # Simplified BSD License (see licenses/simplified_bsd.txt or https://opensource.org/licenses/BSD-2-Clause) from __future__ import absolute_import, division, print_function + __metaclass__ = type import os -import time import random +import time import urllib + +from ansible.module_utils._text import to_native, to_text from ansible.module_utils.six.moves import configparser -from ansible.module_utils._text import to_text, to_native from ansible.module_utils.urls import fetch_url - VULTR_API_ENDPOINT = "https://api.vultr.com" VULTR_USER_AGENT = 'Ansible Vultr' @@ -40,6 +41,14 @@ def __init__(self, module, namespace): collection_name='ngine_io.vultr', version='2.0.0') # Was Ansbile 2.11 + module.deprecate( + msg="This module is deprecated, it uses the deprecated Vultr v1 API. " + "Please switch to the modules in collection vultr.cloud as soon as possible. " + "Also see https://galaxy.ansible.com/vultr/cloud.", + collection_name="ngine_io.vultr", + version="2.0.0" + ) + self.module = module # Namespace use for returns