fixed the raise of KeyError since all values are None if unset
Dieser Commit ist enthalten in:
Ursprung
1884f4045e
Commit
d2375e07a6
|
@ -96,10 +96,10 @@ class AnsibleModule(object):
|
||||||
|
|
||||||
def get(self, key: str, default: T = None) -> T:
|
def get(self, key: str, default: T = None) -> T:
|
||||||
"""returns an Parameter of the Module."""
|
"""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:
|
if self.params[key] is None and default is not None:
|
||||||
return default
|
return default
|
||||||
|
elif self.params[key] is None and default is None:
|
||||||
|
raise KeyError()
|
||||||
return self.params[key]
|
return self.params[key]
|
||||||
|
|
||||||
def changed_get(self):
|
def changed_get(self):
|
||||||
|
|
Laden…
In neuem Issue referenzieren