Skip to content
This repository has been archived by the owner on Oct 4, 2023. It is now read-only.

Commit

Permalink
option to allow self-signed certs for run completion https notification
Browse files Browse the repository at this point in the history
  • Loading branch information
nhammond committed Aug 28, 2017
1 parent 6bd34ec commit 2f564ba
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions loomengine/master/api/models/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,9 @@ def send_notifications(self, context=None):
notification_addresses = []
if self.notification_addresses:
notification_addresses = self.notification_addresses
if get_setting('LOOM_NOTIFICATION_ADDRESSES'):
if get_setting('NOTIFICATION_ADDRESSES'):
notification_addresses = notification_addresses\
+ get_setting('LOOM_NOTIFICATION_ADDRESSES')
+ get_setting('NOTIFICATION_ADDRESSES')
email_addresses = filter(lambda x: '@' in x, notification_addresses)
urls = filter(lambda x: '@' not in x, notification_addresses)
self._send_email_notifications(email_addresses, context)
Expand Down Expand Up @@ -334,7 +334,10 @@ def _send_http_notifications(self, urls, context):
'server_url': context['server_url'],
}
for url in urls:
requests.post(url, data = data)
requests.post(
url,
data = data,
verify=get_setting('NOTIFICATION_HTTPS_VERIFY_CERTIFICATE'))

@classmethod
def get_notification_context(cls, request):
Expand Down
3 changes: 2 additions & 1 deletion loomengine/master/master/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def _get_run_task_playbook_path():
EMAIL_SSL_KEYFILE = os.getenv('LOOM_EMAIL_SSL_KEYFILE', None)
EMAIL_SSL_CERTFILE = os.getenv('LOOM_EMAIL_SSL_CERTFILE', None)
DEFAULT_FROM_EMAIL = os.getenv('LOOM_DEFAULT_FROM_EMAIL', EMAIL_HOST_USER)
LOOM_NOTIFICATION_ADDRESSES = to_list(os.getenv('LOOM_NOTIFICATION_ADDRESSES', '[]'))
NOTIFICATION_ADDRESSES = to_list(os.getenv('LOOM_NOTIFICATION_ADDRESSES', '[]'))
NOTIFICATION_HTTPS_VERIFY_CERTIFICATE = to_boolean(os.getenv('LOOM_NOTIFICATION_HTTPS_VERIFY_CERTIFICATE', True))

# Message broker settings
LOOM_RABBITMQ_PASSWORD = os.getenv('LOOM_RABBITMQ_PASSWORD', 'guest')
Expand Down

0 comments on commit 2f564ba

Please sign in to comment.