From 50e9bfdb1a7eca7e343ff56440e244e405234d2e Mon Sep 17 00:00:00 2001 From: CaptTrews Date: Tue, 1 Oct 2019 00:14:01 +0000 Subject: Updated from network content collector Signed-off-by: CaptTrews --- plugins/module_utils/network/vyos/config/interfaces/interfaces.py | 8 ++++++++ .../network/vyos/config/l3_interfaces/l3_interfaces.py | 8 ++++++++ 2 files changed, 16 insertions(+) (limited to 'plugins') diff --git a/plugins/module_utils/network/vyos/config/interfaces/interfaces.py b/plugins/module_utils/network/vyos/config/interfaces/interfaces.py index e5724f5..d781fd0 100644 --- a/plugins/module_utils/network/vyos/config/interfaces/interfaces.py +++ b/plugins/module_utils/network/vyos/config/interfaces/interfaces.py @@ -114,6 +114,14 @@ class Interfaces(ConfigBase): """ commands = [] state = self._module.params["state"] + + if state in ("merged", "replaced", "overridden") and not want: + self._module.fail_json( + msg="value of config parameter must not be empty for state {0}".format( + state + ) + ) + if state == "overridden": commands.extend(self._state_overridden(want=want, have=have)) diff --git a/plugins/module_utils/network/vyos/config/l3_interfaces/l3_interfaces.py b/plugins/module_utils/network/vyos/config/l3_interfaces/l3_interfaces.py index 2bd04b6..fb7dbdc 100644 --- a/plugins/module_utils/network/vyos/config/l3_interfaces/l3_interfaces.py +++ b/plugins/module_utils/network/vyos/config/l3_interfaces/l3_interfaces.py @@ -115,6 +115,14 @@ class L3_interfaces(ConfigBase): """ commands = [] state = self._module.params["state"] + + if state in ("merged", "replaced", "overridden") and not want: + self._module.fail_json( + msg="value of config parameter must not be empty for state {0}".format( + state + ) + ) + if state == "overridden": commands.extend(self._state_overridden(want=want, have=have)) -- cgit v1.2.3