diff options
author | CaptTrews <capttrews@gmail.com> | 2019-10-01 00:14:01 +0000 |
---|---|---|
committer | CaptTrews <capttrews@gmail.com> | 2019-10-01 00:14:01 +0000 |
commit | 50e9bfdb1a7eca7e343ff56440e244e405234d2e (patch) | |
tree | ec37ffdc027e6a0458346e198799e2bb35174f4b /plugins | |
parent | 1c3031ec21cd14952fb3256600e3ab50fc28fd77 (diff) | |
download | vyos.vyos-50e9bfdb1a7eca7e343ff56440e244e405234d2e.tar.gz vyos.vyos-50e9bfdb1a7eca7e343ff56440e244e405234d2e.zip |
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/module_utils/network/vyos/config/interfaces/interfaces.py | 8 | ||||
-rw-r--r-- | plugins/module_utils/network/vyos/config/l3_interfaces/l3_interfaces.py | 8 |
2 files changed, 16 insertions, 0 deletions
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)) |