这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Feb 8, 2019. It is now read-only.
This repository was archived by the owner on Feb 8, 2019. It is now read-only.

Rocket notifier, set SSL validation to False #91

@hanynowsky

Description

@hanynowsky
  • Rocket webhook urls are in https format. To be able to send a notification to Rocket, we need to set set SS validation to False. Otherwise a SSL handshake error is thrown and notification is not delivered.
  • This is the minor modification:

`

#######
import requests
import traceback

class RocketNotifier:
    def notify(self, notification):

        try:
            payload = { 
                      "text": notification.message
                    }

            response = requests.post(notification.user_to_notify.profile.rocket_webhook_url, payload, verify=False)

            if response.status_code == 200:
                print "Rocket message sent"
            else:
                print "Failed to send Rocket message, API response %s " % response.status_code
        except Exception as e:
            print "Failed to send Rocket message"
            #print(str(e))
            traceback.print_exc()
            raise

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions