mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
zabbix_action: Fixing the default message checking (#54953)
This commit is contained in:
parent
1532e31ec0
commit
0fe63ec2d6
1 changed files with 9 additions and 7 deletions
|
@ -227,9 +227,11 @@ options:
|
|||
message:
|
||||
description:
|
||||
- Operation message text.
|
||||
- Will check the 'default message' and use the text from I(default_message) if this and I(default_subject) are not specified
|
||||
subject:
|
||||
description:
|
||||
- Operation message subject.
|
||||
- Will check the 'default message' and use the text from I(default_subject) if this and I(default_subject) are not specified
|
||||
media_type:
|
||||
description:
|
||||
- Media type that will be used to send the message.
|
||||
|
@ -921,7 +923,7 @@ class Operations(object):
|
|||
"""
|
||||
try:
|
||||
return {
|
||||
'default_msg': '0' if 'message' in operation or 'subject' in operation else '1',
|
||||
'default_msg': '0' if operation.get('message') is not None or operation.get('subject')is not None else '1',
|
||||
'mediatypeid': self._zapi_wrapper.get_mediatype_by_mediatype_name(
|
||||
operation.get('media_type')
|
||||
) if operation.get('media_type') is not None else '0',
|
||||
|
@ -1660,12 +1662,12 @@ def main():
|
|||
state=dict(type='str', required=False, default='present', choices=['present', 'absent']),
|
||||
status=dict(type='str', required=False, default='enabled', choices=['enabled', 'disabled']),
|
||||
pause_in_maintenance=dict(type='bool', required=False, default=True),
|
||||
default_message=dict(type='str', required=False, default=None),
|
||||
default_subject=dict(type='str', required=False, default=None),
|
||||
recovery_default_message=dict(type='str', required=False, default=None),
|
||||
recovery_default_subject=dict(type='str', required=False, default=None),
|
||||
acknowledge_default_message=dict(type='str', required=False, default=None),
|
||||
acknowledge_default_subject=dict(type='str', required=False, default=None),
|
||||
default_message=dict(type='str', required=False, default=''),
|
||||
default_subject=dict(type='str', required=False, default=''),
|
||||
recovery_default_message=dict(type='str', required=False, default=''),
|
||||
recovery_default_subject=dict(type='str', required=False, default=''),
|
||||
acknowledge_default_message=dict(type='str', required=False, default=''),
|
||||
acknowledge_default_subject=dict(type='str', required=False, default=''),
|
||||
conditions=dict(
|
||||
type='list',
|
||||
required=False,
|
||||
|
|
Loading…
Reference in a new issue