diff --git a/plugins/module_utils/module.py b/plugins/module_utils/module.py index 801f9f0..d8fe8f4 100644 --- a/plugins/module_utils/module.py +++ b/plugins/module_utils/module.py @@ -96,10 +96,10 @@ class AnsibleModule(object): def get(self, key: str, default: T = None) -> T: """returns an Parameter of the Module.""" - if key not in self.params: - raise KeyError() if self.params[key] is None and default is not None: return default + elif self.params[key] is None and default is None: + raise KeyError() return self.params[key] def changed_get(self):