diff options
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 e5724f52..d781fd0e 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 2bd04b69..fb7dbdc2 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)) | 
