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

MH VarsMixin deprecation (#6649)

* MH VarsMixin deprecation

* add changelog frag
This commit is contained in:
Alexei Znamensky 2023-06-09 23:27:22 +12:00 committed by GitHub
parent 621bedf751
commit 994f08b37a
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):
"""
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()
def __init__(self, diff=False, output=True, change=None, fact=False):
@ -60,6 +67,12 @@ class VarMeta(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):
self._data = dict()
self._meta = dict()
@ -123,7 +136,12 @@ class VarDict(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):
self.vars = VarDict()
super(VarsMixin, self).__init__(module)