From 258471b267a4315e3b85034a7141b5898ccb75a0 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sun, 31 Jul 2022 11:39:33 +0200 Subject: [PATCH] mh base: add verbosity() property (#5035) (#5036) * mh base: add verbosity property * add changelog fragment (cherry picked from commit aba089369e48d14f2950580ec32ebdba5d3af0c5) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- changelogs/fragments/5035-mh-base-verbosity.yaml | 2 ++ plugins/module_utils/mh/base.py | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/5035-mh-base-verbosity.yaml diff --git a/changelogs/fragments/5035-mh-base-verbosity.yaml b/changelogs/fragments/5035-mh-base-verbosity.yaml new file mode 100644 index 0000000000..e6ea5a9198 --- /dev/null +++ b/changelogs/fragments/5035-mh-base-verbosity.yaml @@ -0,0 +1,2 @@ +minor_changes: + - ModuleHelper module utils - added property ``verbosity`` to base class (https://github.com/ansible-collections/community.general/pull/5035). diff --git a/plugins/module_utils/mh/base.py b/plugins/module_utils/mh/base.py index cad1a9acdc..dec81a4c12 100644 --- a/plugins/module_utils/mh/base.py +++ b/plugins/module_utils/mh/base.py @@ -31,6 +31,10 @@ class ModuleHelperBase(object): def diff_mode(self): return self.module._diff + @property + def verbosity(self): + return self.module._verbosity + def do_raise(self, *args, **kwargs): raise _MHE(*args, **kwargs)