zabbix_action: Fixing the default message checking (#54953)

pull/54990/head
Ruben Tsirunyan 6 years ago committed by ansibot
parent 1532e31ec0
commit 0fe63ec2d6

@ -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…
Cancel
Save