diff options
author | CaptTrews <capttrews@gmail.com> | 2019-09-18 18:01:08 +0000 |
---|---|---|
committer | CaptTrews <capttrews@gmail.com> | 2019-09-18 18:01:08 +0000 |
commit | 447598ada0da54d91cb563a679cfe261158bd7cd (patch) | |
tree | b9123d8b0e1b2948cd9538568b8acb27b5ed9fdd /plugins/module_utils | |
parent | 1f9edfd94ba9a558cf8e7438258a7a0c342c1425 (diff) | |
download | vyos.vyos-447598ada0da54d91cb563a679cfe261158bd7cd.tar.gz vyos.vyos-447598ada0da54d91cb563a679cfe261158bd7cd.zip |
Updated from network content collector
Signed-off-by: CaptTrews <capttrews@gmail.com>
Diffstat (limited to 'plugins/module_utils')
3 files changed, 12 insertions, 0 deletions
diff --git a/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py b/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py index e7f788a..af49f42 100644 --- a/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py +++ b/plugins/module_utils/network/vyos/config/lag_interfaces/lag_interfaces.py @@ -118,6 +118,10 @@ class Lag_interfaces(ConfigBase): """ commands = [] state = self._module.params["state"] + if state in ("merged", "replaced", "overridden") and not want: + self._module.fail_json( + msg="config is required for state {0}".format(state) + ) if state == "overridden": commands.extend(self._state_overridden(want, have)) elif state == "deleted": diff --git a/plugins/module_utils/network/vyos/config/lldp_global/lldp_global.py b/plugins/module_utils/network/vyos/config/lldp_global/lldp_global.py index 54606fa..8570874 100644 --- a/plugins/module_utils/network/vyos/config/lldp_global/lldp_global.py +++ b/plugins/module_utils/network/vyos/config/lldp_global/lldp_global.py @@ -104,6 +104,10 @@ class Lldp_global(ConfigBase): """ commands = [] state = self._module.params["state"] + if state in ("merged", "replaced") and not want: + self._module.fail_json( + msg="config is required for state {0}".format(state) + ) if state == "deleted": commands.extend(self._state_deleted(want=None, have=have)) elif state == "merged": diff --git a/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py b/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py index a22c27e..6b76296 100644 --- a/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py +++ b/plugins/module_utils/network/vyos/config/lldp_interfaces/lldp_interfaces.py @@ -115,6 +115,10 @@ class Lldp_interfaces(ConfigBase): """ commands = [] state = self._module.params["state"] + if state in ("merged", "replaced", "overridden") and not want: + self._module.fail_json( + msg="config is required for state {0}".format(state) + ) if state == "overridden": commands.extend(self._state_overridden(want=want, have=have)) elif state == "deleted": |