Opsgenie don't combine title with body when not required (#655)

pull/650/head^2
Kenton Parton 2022-09-27 23:30:15 +01:00 committed by GitHub
parent 370b1af5a1
commit f1990b14ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -381,8 +381,8 @@ class NotifyOpsgenie(NotifyBase):
# Initialize our has_error flag
has_error = False
# We want to manually set the title onto the body if specified
title_body = body if not title else '{}: {}'.format(title, body)
# Use body if title not set
title_body = body if not title else body
# Create a copy ouf our details object
details = self.details.copy()
@ -402,7 +402,7 @@ class NotifyOpsgenie(NotifyBase):
# limitation
if len(payload['message']) > self.opsgenie_body_minlen:
payload['message'] = '{}...'.format(
body[:self.opsgenie_body_minlen - 3])
title_body[:self.opsgenie_body_minlen - 3])
if self.__tags:
payload['tags'] = self.__tags