|
19 | 19 | import copy |
20 | 20 | import traceback |
21 | 21 | import typing as t |
22 | | -from collections.abc import Mapping |
23 | 22 |
|
24 | 23 | from ansible.errors import AnsibleError |
25 | | -from ansible.module_utils.basic import SEQUENCETYPE, remove_values |
| 24 | +from ansible.module_utils.basic import remove_values |
26 | 25 | from ansible.module_utils.common.arg_spec import ArgumentSpecValidator |
27 | 26 | from ansible.module_utils.errors import UnsupportedError |
28 | 27 | from ansible.plugins.action import ActionBase |
@@ -164,39 +163,9 @@ def _return_formatted(self, kwargs: dict[str, t.Any]) -> t.NoReturn: |
164 | 163 | if "invocation" not in kwargs: |
165 | 164 | kwargs["invocation"] = {"module_args": self.params} |
166 | 165 |
|
167 | | - if "warnings" in kwargs: |
168 | | - if isinstance(kwargs["warnings"], list): |
169 | | - for w in kwargs["warnings"]: |
170 | | - self.warn(w) |
171 | | - else: |
172 | | - self.warn(kwargs["warnings"]) |
173 | | - |
174 | 166 | if self.__warnings: |
175 | 167 | kwargs["warnings"] = self.__warnings |
176 | 168 |
|
177 | | - if "deprecations" in kwargs: |
178 | | - if isinstance(kwargs["deprecations"], list): |
179 | | - for d in kwargs["deprecations"]: |
180 | | - if isinstance(d, SEQUENCETYPE) and len(d) == 2: |
181 | | - self.deprecate(d[0], version=d[1]) |
182 | | - elif isinstance(d, Mapping): |
183 | | - self.deprecate( |
184 | | - d["msg"], |
185 | | - version=d.get("version"), |
186 | | - date=d.get("date"), |
187 | | - collection_name=d.get("collection_name"), |
188 | | - ) |
189 | | - else: |
190 | | - # pylint: disable-next=unknown-option-value |
191 | | - self.deprecate( # pylint: disable=ansible-deprecated-no-version |
192 | | - d |
193 | | - ) |
194 | | - else: |
195 | | - # pylint: disable-next=unknown-option-value |
196 | | - self.deprecate( # pylint: disable=ansible-deprecated-no-version |
197 | | - kwargs["deprecations"] |
198 | | - ) |
199 | | - |
200 | 169 | if self.__deprecations: |
201 | 170 | kwargs["deprecations"] = self.__deprecations |
202 | 171 |
|
|
0 commit comments