From 4470f0696287686b6c15ea59dc06d455ec473dc3 Mon Sep 17 00:00:00 2001 From: Sebastian Tobie Date: Fri, 21 Apr 2023 00:13:38 +0200 Subject: [PATCH] argument_spec is now not merged from middleclasses --- plugins/module_utils/module.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/module.py b/plugins/module_utils/module.py index 44cac13..3db8bed 100644 --- a/plugins/module_utils/module.py +++ b/plugins/module_utils/module.py @@ -40,7 +40,11 @@ class AnsibleModule(object): self.result = dict(changed=False) specs = dict() specs.update(self._common_args) - specs.update(self.module_spec) + modspec = self.module_spec.copy() + if "argument_spec" in modspec and "argument_spec" in self._common_args: + specs["argument_spec"].update(modspec["argument_spec"]) + del modspec["argument_spec"] + specs.update(modspec) self.module = basic.AnsibleModule(**specs) self.tmpdir = pathlib.Path(self.module.tmpdir)