diff options
author | Nathaniel Case <this.is@nathanielca.se> | 2021-03-25 11:42:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-25 15:42:06 +0000 |
commit | c3b2d036bd0c0bf8d338123375a7bcc7de809f34 (patch) | |
tree | 56d8aa516df7ee0ecc3682e777943fdcc6926bd3 /plugins/modules/vyos_vlan.py | |
parent | 6e137ecadc6a7477362117817bf70fc70f1a79dd (diff) | |
download | vyos.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_vlan.py')
-rw-r--r-- | plugins/modules/vyos_vlan.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/modules/vyos_vlan.py b/plugins/modules/vyos_vlan.py index c04ac93..39f371a 100644 --- a/plugins/modules/vyos_vlan.py +++ b/plugins/modules/vyos_vlan.py @@ -167,7 +167,9 @@ import time 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_one_of from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ( remove_default_spec, ) @@ -258,7 +260,10 @@ def map_params_to_obj(module): module.fail_json(msg="vlan_id is required") d["vlan_id"] = str(d["vlan_id"]) - module._check_required_one_of(module.required_one_of, item) + try: + check_required_one_of(module.required_one_of, item) + except TypeError as exc: + module.fail_json(to_text(exc)) obj.append(d) else: |