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:
Rohit 2019-09-19 08:34:31 +05:30 committed by GitHub
parent 1c64dba3c9
commit 978def38d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 11 additions and 11 deletions

View file

@ -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':

View file

@ -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':

View file

@ -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':

View file

@ -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'

View file

@ -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'

View file

@ -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'