diff --git a/changelogs/fragments/6649-varsmixin-deprecation.yml b/changelogs/fragments/6649-varsmixin-deprecation.yml new file mode 100644 index 0000000000..475617893d --- /dev/null +++ b/changelogs/fragments/6649-varsmixin-deprecation.yml @@ -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). diff --git a/plugins/module_utils/mh/mixins/vars.py b/plugins/module_utils/mh/mixins/vars.py index 6dfb29bab8..91f4e4a189 100644 --- a/plugins/module_utils/mh/mixins/vars.py +++ b/plugins/module_utils/mh/mixins/vars.py @@ -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)