error message updated (#62536)
* error message updated Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * test cases updated Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com> * error message updated Signed-off-by: rohitthakur2590 <rohitthakur2590@outlook.com>
This commit is contained in:
parent
1c64dba3c9
commit
978def38d8
6 changed files with 11 additions and 11 deletions
|
@ -108,7 +108,7 @@ 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))
|
||||
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, have))
|
||||
elif state == 'deleted':
|
||||
|
|
|
@ -101,7 +101,7 @@ 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))
|
||||
self._module.fail_json(msg='value of config parameter must not be empty for state {0}'.format(state))
|
||||
if state == 'deleted':
|
||||
commands.extend(self._state_deleted(want=None, have=have))
|
||||
elif state == 'merged':
|
||||
|
|
|
@ -111,7 +111,7 @@ 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))
|
||||
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))
|
||||
elif state == 'deleted':
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state merged'
|
||||
- result.msg == 'value of config parameter must not be empty for state merged'
|
||||
|
||||
- name: Replaced with empty config should give appropriate error message
|
||||
vyos_lag_interfaces:
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state replaced'
|
||||
- result.msg == 'value of config parameter must not be empty for state replaced'
|
||||
|
||||
- name: Overridden with empty config should give appropriate error message
|
||||
vyos_lag_interfaces:
|
||||
|
@ -33,4 +33,4 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state overridden'
|
||||
- result.msg == 'value of config parameter must not be empty for state overridden'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state merged'
|
||||
- result.msg == 'value of config parameter must not be empty for state merged'
|
||||
|
||||
- name: Replaced with empty config should give appropriate error message
|
||||
vyos_lldp_global:
|
||||
|
@ -22,4 +22,4 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state replaced'
|
||||
- result.msg == 'value of config parameter must not be empty for state replaced'
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state merged'
|
||||
- result.msg == 'value of config parameter must not be empty for state merged'
|
||||
|
||||
- name: Replaced with empty config should give appropriate error message
|
||||
vyos_lldp_interfaces:
|
||||
|
@ -22,7 +22,7 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state replaced'
|
||||
- result.msg == 'value of config parameter must not be empty for state replaced'
|
||||
|
||||
- name: Overridden with empty config should give appropriate error message
|
||||
vyos_lldp_interfaces:
|
||||
|
@ -33,4 +33,4 @@
|
|||
|
||||
- assert:
|
||||
that:
|
||||
- result.msg == 'config is required for state overridden'
|
||||
- result.msg == 'value of config parameter must not be empty for state overridden'
|
||||
|
|
Loading…
Reference in a new issue