1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

[PR #6649/994f08b3 backport][stable-7] MH VarsMixin deprecation (#6656)

MH VarsMixin deprecation (#6649)

* MH VarsMixin deprecation

* add changelog frag

(cherry picked from commit 994f08b37a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2023-06-09 17:13:18 +02:00 committed by GitHub
parent d63658ea79
commit fc0981f3f1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 0 deletions

View file

@ -0,0 +1,2 @@
deprecated_features:
- MH VarsMixin module utils - deprecates ``VarsMixin`` and supporting classes in favor of plain ``vardict`` module util (https://github.com/ansible-collections/community.general/pull/6649).

View file

@ -11,6 +11,13 @@ import copy
class VarMeta(object): class VarMeta(object):
"""
DEPRECATION WARNING
This class is deprecated and will be removed in community.general 10.0.0
Modules should use the VarDict from plugins/module_utils/vardict.py instead.
"""
NOTHING = object() NOTHING = object()
def __init__(self, diff=False, output=True, change=None, fact=False): def __init__(self, diff=False, output=True, change=None, fact=False):
@ -60,6 +67,12 @@ class VarMeta(object):
class VarDict(object): class VarDict(object):
"""
DEPRECATION WARNING
This class is deprecated and will be removed in community.general 10.0.0
Modules should use the VarDict from plugins/module_utils/vardict.py instead.
"""
def __init__(self): def __init__(self):
self._data = dict() self._data = dict()
self._meta = dict() self._meta = dict()
@ -123,7 +136,12 @@ class VarDict(object):
class VarsMixin(object): class VarsMixin(object):
"""
DEPRECATION WARNING
This class is deprecated and will be removed in community.general 10.0.0
Modules should use the VarDict from plugins/module_utils/vardict.py instead.
"""
def __init__(self, module=None): def __init__(self, module=None):
self.vars = VarDict() self.vars = VarDict()
super(VarsMixin, self).__init__(module) super(VarsMixin, self).__init__(module)