summaryrefslogtreecommitdiff
path: root/plugins/modules/vyos_logging.py
diff options
context:
space:
mode:
authorNathaniel Case <this.is@nathanielca.se>2021-03-25 11:42:06 -0400
committerGitHub <noreply@github.com>2021-03-25 15:42:06 +0000
commitc3b2d036bd0c0bf8d338123375a7bcc7de809f34 (patch)
tree56d8aa516df7ee0ecc3682e777943fdcc6926bd3 /plugins/modules/vyos_logging.py
parent6e137ecadc6a7477362117817bf70fc70f1a79dd (diff)
downloadvyos.vyos-c3b2d036bd0c0bf8d338123375a7bcc7de809f34.tar.gz
vyos.vyos-c3b2d036bd0c0bf8d338123375a7bcc7de809f34.zip
Replace module._check_required_* calls (#140)
Replace removed module._check_required_* calls Reviewed-by: https://github.com/apps/ansible-zuul
Diffstat (limited to 'plugins/modules/vyos_logging.py')
-rw-r--r--plugins/modules/vyos_logging.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/modules/vyos_logging.py b/plugins/modules/vyos_logging.py
index c7780d8e..d4f0cfc4 100644
--- a/plugins/modules/vyos_logging.py
+++ b/plugins/modules/vyos_logging.py
@@ -152,7 +152,9 @@ import re
from copy import deepcopy
+from ansible.module_utils._text import to_text
from ansible.module_utils.basic import AnsibleModule
+from ansible.module_utils.common.validation import check_required_if
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import (
remove_default_spec,
)
@@ -256,7 +258,10 @@ def map_params_to_obj(module, required_if=None):
if item.get(key) is None:
item[key] = module.params[key]
- module._check_required_if(required_if, item)
+ try:
+ check_required_if(required_if, item)
+ except TypeError as exc:
+ module.fail_json(to_text(exc))
obj.append(item.copy())
else:
@@ -294,7 +299,7 @@ def main():
remove_default_spec(aggregate_spec)
argument_spec = dict(
- aggregate=dict(type="list", elements="dict", options=aggregate_spec),
+ aggregate=dict(type="list", elements="dict", options=aggregate_spec)
)
argument_spec.update(element_spec)