From fc0981f3f182941cacd94180ef615b1599d703b9 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 17:13:18 +0200 Subject: [PATCH] [PR #6649/994f08b3 backport][stable-7] MH VarsMixin deprecation (#6656) MH VarsMixin deprecation (#6649) * MH VarsMixin deprecation * add changelog frag (cherry picked from commit 994f08b37a72f78f923088318cfb7cce550d123a) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- .../fragments/6649-varsmixin-deprecation.yml | 2 ++ plugins/module_utils/mh/mixins/vars.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 changelogs/fragments/6649-varsmixin-deprecation.yml 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)